MCPcopy
hub / github.com/webpack/webpack / cutOffByFlag

Function cutOffByFlag

lib/ErrorHelpers.js:18–26  ·  view source on GitHub ↗
(stack, flag)

Source from the content-addressed store, hash-verified

16 * @returns {string} stack trace without the specified flag included
17 */
18const cutOffByFlag = (stack, flag) => {
19 const errorStack = stack.split("\n");
20 for (let i = 0; i < errorStack.length; i++) {
21 if (errorStack[i].includes(flag)) {
22 errorStack.length = i;
23 }
24 }
25 return errorStack.join("\n");
26};
27
28/**
29 * Cut off loader execution.

Callers 2

cutOffLoaderExecutionFunction · 0.85
cutOffWebpackOptionsFunction · 0.85

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected