MCPcopy Create free account
hub / github.com/babel/babel / push

Function push

packages/babel-node/scripts/list-node-flags.js:11–22  ·  view source on GitHub ↗
(flag)

Source from the content-addressed store, hash-verified

9const knownFlagsSet = new Set(flags);
10
11function push(flag) {
12 if (knownFlagsSet.has(flag)) return;
13
14 if (!process.argv.includes("--update")) {
15 throw new Error(
16 `Missing flag "${flag}" from Node.js ${process.version} in ./packages/babel-node/data/node-flags-with-value.json.\n` +
17 `Run node ./packages/babel-node/scripts/list-node-flags.js --update to update it.`
18 );
19 }
20
21 flags.push(flag);
22}
23
24const out = cp.execSync(`${process.execPath} --help`).toString();
25const re = /(?:(-\w), )?(--[\w-]+)\[?(?:=| \[)/g;

Callers 1

list-node-flags.jsFile · 0.70

Calls 2

hasMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected