(nodeVersion: string)
| 60 | * warning. |
| 61 | */ |
| 62 | export function nodeRuntimeFlagsFor(nodeVersion: string): readonly string[] { |
| 63 | // `--disable-warning` landed in Node 20.11 / 21.3; older nodes treat it as |
| 64 | // a fatal "bad option" at spawn. Those runtimes can't run codegraph anyway |
| 65 | // (node:sqlite needs >= 22.5), but let them reach our own version messaging |
| 66 | // instead of a cryptic spawn failure. |
| 67 | const [major = 0, minor = 0] = nodeVersion.split('.').map(Number); |
| 68 | const supported = major > 21 || (major === 21 && minor >= 3) || (major === 20 && minor >= 11); |
| 69 | return supported ? ['--disable-warning=ExperimentalWarning', '--max-semi-space-size=16'] : []; |
| 70 | } |
| 71 | |
| 72 | export const NODE_RUNTIME_FLAGS: readonly string[] = nodeRuntimeFlagsFor(process.versions.node); |
| 73 |
no test coverage detected