MCPcopy
hub / github.com/rollup/rollup / normaliseError

Function normaliseError

test/testHelpers.js:67–84  ·  view source on GitHub ↗
(error)

Source from the content-addressed store, hash-verified

65};
66
67function normaliseError(error) {
68 if (!error) {
69 throw new Error(`Expected an error but got ${JSON.stringify(error)}`);
70 }
71 const clone = { ...error, message: error.message };
72 delete clone.stack;
73 delete clone.toString;
74 if (clone.watchFiles) {
75 clone.watchFiles.sort();
76 }
77 if (clone.frame) {
78 clone.frame = clone.frame.replace(/\s+$/gm, '');
79 }
80 if (clone.cause) {
81 clone.cause = normaliseError(clone.cause);
82 }
83 return clone;
84}
85
86/**
87 * @param {RollupError} actual

Callers 1

testHelpers.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…