MCPcopy Index your code
hub / github.com/formatjs/formatjs / requiredArg

Function requiredArg

tools/generate-package-json.ts:300–306  ·  view source on GitHub ↗
(args: Args, name: keyof Args)

Source from the content-addressed store, hash-verified

298}
299
300function requiredArg(args: Args, name: keyof Args): string {
301 const value = args[name]
302 if (typeof value !== 'string' || !value) {
303 throw new Error(`--${String(name)} is required`)
304 }
305 return value
306}
307
308function main(args: Args): void {
309 const rootPackageJsonPath = requiredArg(args, 'root-package-json')

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected