MCPcopy Create free account
hub / github.com/aidenybai/bippy / parseStack

Function parseStack

packages/bippy/src/source/parse-stack.ts:30–52  ·  view source on GitHub ↗
(stackString: string, options?: ParseOptions)

Source from the content-addressed store, hash-verified

28 const frames: StackFrame[] = [];
29 for (const rawLine of lines) {
30 if (/^\s*at\s+/.test(rawLine)) {
31 if (CHROME_IE_STACK_REGEXP.test(rawLine)) frames.push(parseV8Line(rawLine));
32 } else if (/^\s*in\s+/.test(rawLine)) {
33 const elementName = rawLine
34 .replace(/^\s*in\s+/, "")
35 .replace(/\s*(?:\(at .*\)|\[[^\]]+\])$/, "");
36 frames.push({ functionName: elementName, source: rawLine });
37 } else if (rawLine.match(FIREFOX_SAFARI_STACK_REGEXP)) {
38 if (!SAFARI_NATIVE_CODE_REGEXP.test(rawLine)) frames.push(parseSafariLine(rawLine));
39 }
40 }
41 return frames;
42 }
43 if (stackString.match(CHROME_IE_STACK_REGEXP)) {
44 return parseV8OrIeString(stackString);
45 }
46 return parseFFOrSafariString(stackString);
47};
48
49const getPositionIndex = (location: string, endIndex: number): number => {
50 let positionIndex = endIndex - 1;
51 while (positionIndex >= 0) {
52 const character = location.charCodeAt(positionIndex);
53 if (character < 48 || character > 57) break;
54 positionIndex--;
55 }

Callers 3

getOwnerStackEntriesFunction · 0.85
getOwnerStackFunction · 0.85
parseErrorStackFunction · 0.85

Calls 3

parseV8OrIeStringFunction · 0.85
parseFFOrSafariStringFunction · 0.85
applySliceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…