MCPcopy
hub / github.com/angular/angular / convertArraysFromArgs

Function convertArraysFromArgs

packages/localize/tools/src/translate/cli.ts:126–135  ·  view source on GitHub ↗

* Parse each of the given string `args` and convert it to an array if it is of the form * `[abc, def, ghi]`, i.e. it is enclosed in square brackets with comma delimited items. * @param args The string to potentially convert to arrays.

(args: string[])

Source from the content-addressed store, hash-verified

124 * @param args The string to potentially convert to arrays.
125 */
126function convertArraysFromArgs(args: string[]): (string | string[])[] {
127 return args.map((arg) =>
128 arg.startsWith('[') && arg.endsWith(']')
129 ? arg
130 .slice(1, -1)
131 .split(',')
132 .map((arg) => arg.trim())
133 : arg,
134 );
135}

Callers 1

cli.tsFile · 0.85

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…