This commit is contained in:
Stefan Pejcic
2024-05-08 19:58:53 +02:00
parent 440d98beff
commit 8595a9f4e5
2479 changed files with 591504 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import type { StackFrame } from "error-stack-parser";
const unrelatedFunctionName = "renderWithHooks";
export const cleanStack = (stack: StackFrame[]) => {
const firstUnrelatedIndex = stack.findIndex(
(frame) => frame.functionName === unrelatedFunctionName,
);
if (firstUnrelatedIndex !== -1) {
return stack.slice(0, firstUnrelatedIndex);
}
return stack;
};