MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / getCliFlags

Function getCliFlags

packages/vite/helpers/cli-flags.ts:5–16  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3let cliFlags: Record<string, string | boolean> | null = null;
4
5export function getCliFlags() {
6 if (!cliFlags) {
7 const cliArgs = minimist(process.argv.slice(2), { '--': true });
8 cliFlags = (cliArgs['--'] || []).reduce((obj, flag) => {
9 // remove env prefix
10 const [rawKey, ...rest] = flag.replace(/^--env\./, '').split('=');
11 obj[rawKey] = rest.length === 0 ? true : rest.join('=');
12 return obj;
13 }, {});
14 }
15 return cliFlags;
16}

Callers 6

angular.tsFile · 0.85
baseConfigFunction · 0.85
vueConfigFunction · 0.85

Calls 4

reduceMethod · 0.80
replaceMethod · 0.80
joinMethod · 0.80
sliceMethod · 0.45

Tested by

no test coverage detected