MCPcopy Index your code
hub / github.com/react/react / addDefaultParamValue

Function addDefaultParamValue

scripts/release/utils.js:20–33  ·  view source on GitHub ↗
(optionalShortName, longName, defaultValue)

Source from the content-addressed store, hash-verified

18});
19
20const addDefaultParamValue = (optionalShortName, longName, defaultValue) => {
21 let found = false;
22 for (let i = 0; i < process.argv.length; i++) {
23 const current = process.argv[i];
24 if (current === optionalShortName || current.startsWith(`${longName}=`)) {
25 found = true;
26 break;
27 }
28 }
29
30 if (!found) {
31 process.argv.push(`${longName}=${defaultValue}`);
32 }
33};
34
35const confirm = async message => {
36 const confirmation = await prompt(theme`\n{caution ${message}} (y/N) `);

Callers 1

runFunction · 0.85

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected