(stack, message)
| 66 | * @returns {string} stack trace without the message included |
| 67 | */ |
| 68 | const 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. |