MCPcopy Index your code
hub / github.com/coder/coder / shortenMessage

Function shortenMessage

site/scripts/check-compiler.mjs:96–104  ·  view source on GitHub ↗
(msg)

Source from the content-addressed store, hash-verified

94 * → "Ref values are not allowed"
95 */
96export function shortenMessage(msg) {
97 const str = typeof msg === "string" ? msg : String(msg);
98 return str
99 .replace(/^Error: /, "")
100 .split(/\.\s/)[0]
101 .split("(http")[0]
102 .replace(/\.\s*$/, "")
103 .trim();
104}
105
106/**
107 * Remove diagnostics that share the same line + message. The compiler

Callers 2

logEventFunction · 0.85

Calls 1

StringFunction · 0.50

Tested by

no test coverage detected