MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / parseArgs

Function parseArgs

scripts/studio-host-provider.mjs:690–707  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

688}
689
690function parseArgs(argv) {
691 const args = {};
692 for (let index = 0; index < argv.length; index += 1) {
693 const item = argv[index];
694 if (!item.startsWith("--")) {
695 continue;
696 }
697 const key = item.slice(2);
698 const next = argv[index + 1];
699 if (!next || next.startsWith("--")) {
700 args[key] = "1";
701 continue;
702 }
703 args[key] = next;
704 index += 1;
705 }
706 return args;
707}
708
709function requiredArg(args, name) {
710 const value = args[name];

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected