Sha256: dfbd531639e7c4ff0e834dfc3630357641e9037c59ca9faedd221fdf3c26e86b
Contents?: true
Size: 659 Bytes
Versions: 26
Compression:
Stored size: 659 Bytes
Contents
const SOURCE_FRAME = /[\/\\]msw[\/\\]src[\/\\](.+)/; const BUILD_FRAME = /(node_modules)?[\/\\]lib[\/\\](core|browser|node|native|iife)[\/\\]|^[^\/\\]*$/; function getCallFrame(error) { const stack = error.stack; if (!stack) { return; } const frames = stack.split("\n").slice(1); const declarationFrame = frames.find((frame) => { return !(SOURCE_FRAME.test(frame) || BUILD_FRAME.test(frame)); }); if (!declarationFrame) { return; } const declarationPath = declarationFrame.replace(/\s*at [^()]*\(([^)]+)\)/, "$1").replace(/^@/, ""); return declarationPath; } export { getCallFrame }; //# sourceMappingURL=getCallFrame.mjs.map
Version data entries
26 entries across 26 versions & 1 rubygems