MCPcopy
hub / github.com/triggerdotdev/trigger.dev / getArg

Function getArg

apps/webapp/prisma/populate.ts:76–88  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

74}
75
76function getArg(name: string) {
77 const args = process.argv.slice(2);
78
79 let value = "";
80
81 args.forEach((val) => {
82 if (val.startsWith(`--${name}=`)) {
83 value = val.split("=")[1];
84 }
85 });
86
87 return !value ? undefined : value;
88}
89
90function randomIndex<T>(array: T[]) {
91 return Math.floor(Math.random() * array.length);

Callers 1

populateFunction · 0.85

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…