MCPcopy Create free account
hub / github.com/ProNextJS/declarative-routing / parseArray

Function parseArray

assets/shared/utils.ts:176–184  ·  view source on GitHub ↗
(
  values: string[],
  parseFunction: (str: string) => ParsedData<T>
)

Source from the content-addressed store, hash-verified

174}
175
176function parseArray<T>(
177 values: string[],
178 parseFunction: (str: string) => ParsedData<T>
179): ParsedData<T[]> {
180 const numbers = values.map(parseFunction);
181 const error = numbers.find((n) => n.error)?.error;
182 if (error) return { error };
183 return { data: numbers.map((n) => n.data!) };
184}

Callers 1

parseValuesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected