MCPcopy
hub / github.com/prisma/prisma / arg

Function arg

packages/internals/src/cli/utils.ts:14–25  ·  view source on GitHub ↗
(
  argv: string[],
  spec: T,
  stopAtPositional = true,
  permissive = false,
)

Source from the content-addressed store, hash-verified

12 * Wrap arg to return an error instead of throwing
13 */
14export function arg<T extends Arg.Spec>(
15 argv: string[],
16 spec: T,
17 stopAtPositional = true,
18 permissive = false,
19): Arg.Result<T> | Error {
20 try {
21 return Arg(spec, { argv, stopAtPositional, permissive })
22 } catch (e: any) {
23 return e
24 }
25}
26
27/**
28 * Check if result is an error

Callers 15

run-tests.tsFile · 0.90
run.tsFile · 0.90
bin.tsFile · 0.90
parseMethod · 0.90
parseMethod · 0.90
parseMethod · 0.90
parseMethod · 0.90
parseMethod · 0.90
parseMethod · 0.90
parseMethod · 0.90
parseMethod · 0.90
parseMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected