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

Function parseJsonArrayEnv

scripts/studio-provider-bridge.mjs:699–716  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

697}
698
699function parseJsonArrayEnv(name) {
700 const raw = process.env[name];
701 if (!raw) {
702 return null;
703 }
704 try {
705 const value = JSON.parse(raw);
706 if (
707 Array.isArray(value) &&
708 value.every((item) => typeof item === "string")
709 ) {
710 return value;
711 }
712 } catch {
713 return null;
714 }
715 return null;
716}
717
718function isMainModule() {
719 return import.meta.url === pathToFileURL(process.argv[1] || "").href;

Callers 1

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected