MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / firstMeaningfulLine

Function firstMeaningfulLine

scripts/smoke-test-packed.ts:81–98  ·  view source on GitHub ↗
(stderr: string)

Source from the content-addressed store, hash-verified

79const PRIVATE_PACKAGE_RE = /Cannot find package '(@executor-js\/[^']+)'/;
80
81const firstMeaningfulLine = (stderr: string): string => {
82 const lines = stderr
83 .split("\n")
84 .map((line) => line.trim())
85 .filter(Boolean);
86 const errorLine = lines.find((line) => /^(\w*Error|Cannot find)/i.test(line));
87 if (errorLine) return errorLine;
88 for (const line of lines) {
89 if (line.startsWith("node:")) continue;
90 if (line.startsWith("file://")) continue;
91 if (line.startsWith("at ")) continue;
92 if (line.startsWith("import ")) continue;
93 if (line.startsWith("throw ")) continue;
94 if (line === "^" || /^\^+$/.test(line)) continue;
95 return line;
96 }
97 return lines[0] ?? "(no stderr)";
98};
99
100type Tarballs = ReadonlyMap<string, string>;
101

Callers 1

smokeTestPackageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected