MCPcopy Index your code
hub / github.com/webpack/webpack / cutOffMessage

Function cutOffMessage

lib/ErrorHelpers.js:68–75  ·  view source on GitHub ↗
(stack, message)

Source from the content-addressed store, hash-verified

66 * @returns {string} stack trace without the message included
67 */
68const cutOffMessage = (stack, message) => {
69 const nextLine = stack.indexOf("\n");
70 if (nextLine === -1) {
71 return stack === message ? "" : stack;
72 }
73 const firstLine = stack.slice(0, nextLine);
74 return firstLine === message ? stack.slice(nextLine + 1) : stack;
75};
76
77/**
78 * Returns stack trace without the loader execution flag and message included.

Callers 1

cleanUpFunction · 0.85

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected