()
| 17 | } |
| 18 | |
| 19 | function 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 | |
| 35 | function readReadmeCommandKeys(): Set<string> { |
| 36 | const text = readFileSync(README_PATH, "utf8"); |
no test coverage detected