File: /home/cafsindia/snap.cafsinfotech.in/node_modules/@sentry/utils/cjs/node-stack-trace.js.map
{"version":3,"file":"node-stack-trace.js","sources":["../../src/node-stack-trace.ts"],"sourcesContent":["// This code was originally forked from https://github.com/felixge/node-stack-trace\n// Since then it has been highly modified to fit our needs.\n\n// Copyright (c) 2011 Felix Geisendörfer (felix@debuggable.com)//\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions://\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.//\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport type { StackLineParserFn } from '@sentry/types';\n\nexport type GetModuleFn = (filename: string | undefined) => string | undefined;\n\n/**\n * Does this filename look like it's part of the app code?\n */\nexport function filenameIsInApp(filename: string, isNative: boolean = false): boolean {\n const isInternal =\n isNative ||\n (filename &&\n // It's not internal if it's an absolute linux path\n !filename.startsWith('/') &&\n // It's not internal if it's an absolute windows path\n !filename.includes(':\\\\') &&\n // It's not internal if the path is starting with a dot\n !filename.startsWith('.') &&\n // It's not internal if the frame has a protocol. In node, this is usually the case if the file got pre-processed with a bundler like webpack\n !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\\-+])*:\\/\\//)); // Schema from: https://stackoverflow.com/a/3641782\n\n // in_app is all that's not an internal Node function or a module within node_modules\n // note that isNative appears to return true even for node core libraries\n // see https://github.com/getsentry/raven-node/issues/176\n\n return !isInternal && filename !== undefined && !filename.includes('node_modules/');\n}\n\n/** Node Stack line parser */\n// eslint-disable-next-line complexity\nexport function node(getModule?: GetModuleFn): StackLineParserFn {\n const FILENAME_MATCH = /^\\s*[-]{4,}$/;\n const FULL_MATCH = /at (?:async )?(?:(.+?)\\s+\\()?(?:(.+):(\\d+):(\\d+)?|([^)]+))\\)?/;\n\n // eslint-disable-next-line complexity\n return (line: string) => {\n const lineMatch = line.match(FULL_MATCH);\n\n if (lineMatch) {\n let object: string | undefined;\n let method: string | undefined;\n let functionName: string | undefined;\n let typeName: string | undefined;\n let methodName: string | undefined;\n\n if (lineMatch[1]) {\n functionName = lineMatch[1];\n\n let methodStart = functionName.lastIndexOf('.');\n if (functionName[methodStart - 1] === '.') {\n methodStart--;\n }\n\n if (methodStart > 0) {\n object = functionName.slice(0, methodStart);\n method = functionName.slice(methodStart + 1);\n const objectEnd = object.indexOf('.Module');\n if (objectEnd > 0) {\n functionName = functionName.slice(objectEnd + 1);\n object = object.slice(0, objectEnd);\n }\n }\n typeName = undefined;\n }\n\n if (method) {\n typeName = object;\n methodName = method;\n }\n\n if (method === '<anonymous>') {\n methodName = undefined;\n functionName = undefined;\n }\n\n if (functionName === undefined) {\n methodName = methodName || '<anonymous>';\n functionName = typeName ? `${typeName}.${methodName}` : methodName;\n }\n\n let filename = lineMatch[2] && lineMatch[2].startsWith('file://') ? lineMatch[2].slice(7) : lineMatch[2];\n const isNative = lineMatch[5] === 'native';\n\n if (!filename && lineMatch[5] && !isNative) {\n filename = lineMatch[5];\n }\n\n return {\n filename,\n module: getModule ? getModule(filename) : undefined,\n function: functionName,\n lineno: parseInt(lineMatch[3], 10) || undefined,\n colno: parseInt(lineMatch[4], 10) || undefined,\n in_app: filenameIsInApp(filename, isNative),\n };\n }\n\n if (line.match(FILENAME_MATCH)) {\n return {\n filename: line,\n };\n }\n\n return undefined;\n };\n}\n"],"names":[],"mappings":";;AA2BA;AACA;AACA;AACA,SAAA,eAAA,CAAA,QAAA,EAAA,QAAA,GAAA,KAAA,EAAA;AACA,EAAA,MAAA,UAAA;AACA,IAAA,QAAA;AACA,KAAA,QAAA;AACA;AACA,MAAA,CAAA,QAAA,CAAA,UAAA,CAAA,GAAA,CAAA;AACA;AACA,MAAA,CAAA,QAAA,CAAA,QAAA,CAAA,KAAA,CAAA;AACA;AACA,MAAA,CAAA,QAAA,CAAA,UAAA,CAAA,GAAA,CAAA;AACA;AACA,MAAA,CAAA,QAAA,CAAA,KAAA,CAAA,kCAAA,CAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,OAAA,CAAA,UAAA,IAAA,QAAA,KAAA,SAAA,IAAA,CAAA,QAAA,CAAA,QAAA,CAAA,eAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA,SAAA,IAAA,CAAA,SAAA,EAAA;AACA,EAAA,MAAA,cAAA,GAAA,cAAA,CAAA;AACA,EAAA,MAAA,UAAA,GAAA,+DAAA,CAAA;AACA;AACA;AACA,EAAA,OAAA,CAAA,IAAA,KAAA;AACA,IAAA,MAAA,SAAA,GAAA,IAAA,CAAA,KAAA,CAAA,UAAA,CAAA,CAAA;AACA;AACA,IAAA,IAAA,SAAA,EAAA;AACA,MAAA,IAAA,MAAA,CAAA;AACA,MAAA,IAAA,MAAA,CAAA;AACA,MAAA,IAAA,YAAA,CAAA;AACA,MAAA,IAAA,QAAA,CAAA;AACA,MAAA,IAAA,UAAA,CAAA;AACA;AACA,MAAA,IAAA,SAAA,CAAA,CAAA,CAAA,EAAA;AACA,QAAA,YAAA,GAAA,SAAA,CAAA,CAAA,CAAA,CAAA;AACA;AACA,QAAA,IAAA,WAAA,GAAA,YAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA;AACA,QAA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