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

Function firstMeaningfulLine

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

Source from the content-addressed store, hash-verified

86 /The requested module '([^']+)' does not provide an export named '([^']+)'/;
87
88const firstMeaningfulLine = (stderr: string): string => {
89 const lines = stderr
90 .split("\n")
91 .map((line) => line.trim())
92 .filter(Boolean);
93 const errorLine = lines.find((line) => /^(\w*Error|Cannot find)/i.test(line));
94 if (errorLine) return errorLine;
95 for (const line of lines) {
96 if (line.startsWith("node:")) continue;
97 if (line.startsWith("file://")) continue;
98 if (line.startsWith("at ")) continue;
99 if (line.startsWith("import ")) continue;
100 if (line.startsWith("throw ")) continue;
101 if (line === "^" || /^\^+$/.test(line)) continue;
102 return line;
103 }
104 return lines[0] ?? "(no stderr)";
105};
106
107type Tarballs = ReadonlyMap<string, string>;
108

Callers 1

smokeTestPackageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected