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

Function collect

packages/babel-node/src/program-setup.ts:5–16  ·  view source on GitHub ↗
(value: unknown, previousValue: string[])

Source from the content-addressed store, hash-verified

3export const program = commander.program;
4
5function collect(value: unknown, previousValue: string[]): string[] {
6 // If the user passed the option with no value, like "babel-node file.js --presets", do nothing.
7 if (typeof value !== "string") return previousValue;
8
9 const values = value.split(",");
10
11 if (previousValue) {
12 previousValue.push(...values);
13 return previousValue;
14 }
15 return values;
16}
17
18program.name("babel-node");
19program.option("-e, --eval [script]", "Evaluate script");

Callers

nothing calls this directly

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected