- Add GETTING_STARTED.md with quick start guide and development modes - Add INSTALL.sh automated installation script - Add INSTALLATION_CHECKLIST.md, INSTALLATION_SUCCESS.md, and INSTALLATION_SUMMARY.md - Add QUICK_REFERENCE.md for common commands - Add SETUP_GUIDE.md with detailed setup instructions - Update README.md with improved project overview - Add did-wallet app dependencies and node_modules
29 lines
754 B
JavaScript
29 lines
754 B
JavaScript
import { isError } from "./error.js";
|
|
export function parseArguments(args) {
|
|
let options, shortMessage = "";
|
|
if (args.length === 0) {
|
|
options = {};
|
|
}
|
|
else if (isError(args[0])) {
|
|
options = {
|
|
cause: args[0]
|
|
};
|
|
shortMessage = args.slice(1).join(" ") || "";
|
|
}
|
|
else if (args[0] && typeof args[0] === "object") {
|
|
options = Object.assign({}, args[0]);
|
|
shortMessage = args.slice(1).join(" ") || "";
|
|
}
|
|
else if (typeof args[0] === "string") {
|
|
options = {};
|
|
shortMessage = shortMessage = args.join(" ") || "";
|
|
}
|
|
else {
|
|
throw new Error("Invalid arguments passed to Layerr");
|
|
}
|
|
return {
|
|
options,
|
|
shortMessage
|
|
};
|
|
}
|