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