MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / formatError

Function formatError

test/utils.ts:311–329  ·  view source on GitHub ↗
(errors: ParsingDiagnostic[])

Source from the content-addressed store, hash-verified

309 return [
310 'Error',
311 [
312 'String',
313 ...(errors.map((x) => {
314 // If we have an array as the last element, it's the trace. Remove it.
315 if (
316 Array.isArray(x.message) &&
317 Array.isArray(x.message[x.message.length - 1])
318 ) {
319 return x.message.slice(0, -1);
320 }
321
322 return x.message;
323 }) as Expression[]),
324 ],
325 ];
326}
327
328export function validEpsil(s: string): Expression | null {
329 const [value, errors] = parseEpsil(s);
330 if (errors && errors.length > 0) return formatError(errors);
331 return strip(value);
332}

Callers 2

validCortexFunction · 0.85
invalidCortexFunction · 0.85

Calls 2

mapMethod · 0.65
sliceMethod · 0.65

Tested by

no test coverage detected