MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / readPackageScriptKeys

Function readPackageScriptKeys

apps/ui/scripts/check-scripts-docs.ts:19–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17}
18
19function readPackageScriptKeys(): string[] {
20 const parsed: unknown = JSON.parse(readFileSync(PACKAGE_JSON_PATH, "utf8"));
21 const scripts: Record<string, unknown> =
22 isRecord(parsed) && isRecord(parsed.scripts) ? parsed.scripts : {};
23
24 return Object.entries(scripts)
25 .filter(([key, value]) => {
26 if (SKIP_SCRIPT_KEYS.has(key)) {
27 return false;
28 }
29
30 return typeof value === "string" && referencesScriptsDir(value);
31 })
32 .map(([key]) => key);
33}
34
35function readReadmeCommandKeys(): Set<string> {
36 const text = readFileSync(README_PATH, "utf8");

Callers 1

mainFunction · 0.70

Calls 3

isRecordFunction · 0.70
referencesScriptsDirFunction · 0.70
hasMethod · 0.45

Tested by

no test coverage detected