This commit is contained in:
2022-07-18 02:50:52 +00:00
parent befd344ab0
commit 06181b34d6
8569 changed files with 818704 additions and 352705 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
error-stack-parser.js - Extract meaning from JS Errors
===============
[![Build Status](https://img.shields.io/travis/stacktracejs/error-stack-parser/master.svg?style=flat-square)](https://travis-ci.org/stacktracejs/error-stack-parser)
[![Build Status](https://img.shields.io/github/workflow/status/stacktracejs/error-stack-parser/Continuous%20Integration/master?logo=github&style=flat-square)](https://github.com/stacktracejs/error-stack-parser/actions?query=workflow%3AContinuous+Integration+branch%3Amaster)
[![Coverage Status](https://img.shields.io/coveralls/stacktracejs/error-stack-parser.svg?style=flat-square)](https://coveralls.io/r/stacktracejs/error-stack-parser?branch=master)
[![GitHub license](https://img.shields.io/github/license/stacktracejs/error-stack-parser.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![size with dependencies](https://img.shields.io/badge/size-4.8k-green.svg?style=flat-square)](https://github.com/stacktracejs/error-stack-parser/releases)
+7 -7
View File
@@ -56,21 +56,21 @@
return filtered.map(function(line) {
if (line.indexOf('(eval ') > -1) {
// Throw away eval information until we implement stacktrace.js/stackframe#8
line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(,.*$)/g, '');
}
var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '(');
var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '(').replace(/^.*?\s+/, '');
// capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in
// case it has spaces in it, as the string is split on \s+ later on
var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/);
var location = sanitizedLine.match(/ (\(.+\)$)/);
// remove the parenthesized location from the line, if it was matched
sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;
var tokens = sanitizedLine.split(/\s+/).slice(1);
// if a location was matched, pass it to extractLocation() otherwise pop the last token
var locationParts = this.extractLocation(location ? location[1] : tokens.pop());
var functionName = tokens.join(' ') || undefined;
// if a location was matched, pass it to extractLocation() otherwise pass all sanitizedLine
// because this line doesn't have function name
var locationParts = this.extractLocation(location ? location[1] : sanitizedLine);
var functionName = location && sanitizedLine || undefined;
var fileName = ['eval', '<anonymous>'].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];
return new StackFrame({
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+4 -51
View File
@@ -1,59 +1,12 @@
// Type definitions for ErrorStackParser v2.0.0
// Type definitions for ErrorStackParser v2.1.0
// Project: https://github.com/stacktracejs/error-stack-parser
// Definitions by: Eric Wendelin <https://www.eriwen.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module ErrorStackParser {
export interface StackFrame {
constructor(object: StackFrame): StackFrame;
isConstructor?: boolean;
getIsConstructor(): boolean;
setIsConstructor(): void;
isEval?: boolean;
getIsEval(): boolean;
setIsEval(): void;
isNative?: boolean;
getIsNative(): boolean;
setIsNative(): void;
isTopLevel?: boolean;
getIsTopLevel(): boolean;
setIsTopLevel(): void;
columnNumber?: number;
getColumnNumber(): number;
setColumnNumber(): void;
lineNumber?: number;
getLineNumber(): number;
setLineNumber(): void;
fileName?: string;
getFileName(): string;
setFileName(): void;
functionName?: string;
getFunctionName(): string;
setFunctionName(): void;
source?: string;
getSource(): string;
setSource(): void;
args?: any[];
getArgs(): any[];
setArgs(): void;
evalOrigin?: StackFrame;
getEvalOrigin(): StackFrame;
setEvalOrigin(): void;
toString(): string;
}
import StackFrame = require("stackframe");
declare namespace ErrorStackParser {
export type {StackFrame};
/**
* Given an Error object, extract the most information from it.
*
+7 -7
View File
@@ -56,21 +56,21 @@
return filtered.map(function(line) {
if (line.indexOf('(eval ') > -1) {
// Throw away eval information until we implement stacktrace.js/stackframe#8
line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(,.*$)/g, '');
}
var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '(');
var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '(').replace(/^.*?\s+/, '');
// capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in
// case it has spaces in it, as the string is split on \s+ later on
var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/);
var location = sanitizedLine.match(/ (\(.+\)$)/);
// remove the parenthesized location from the line, if it was matched
sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;
var tokens = sanitizedLine.split(/\s+/).slice(1);
// if a location was matched, pass it to extractLocation() otherwise pop the last token
var locationParts = this.extractLocation(location ? location[1] : tokens.pop());
var functionName = tokens.join(' ') || undefined;
// if a location was matched, pass it to extractLocation() otherwise pass all sanitizedLine
// because this line doesn't have function name
var locationParts = this.extractLocation(location ? location[1] : sanitizedLine);
var functionName = location && sanitizedLine || undefined;
var fileName = ['eval', '<anonymous>'].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];
return new StackFrame({
+24 -24
View File
@@ -1,55 +1,55 @@
{
"_args": [
[
"error-stack-parser@2.0.6",
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
"error-stack-parser@2.1.4",
"/home/node/nuxt"
]
],
"_from": "error-stack-parser@2.0.6",
"_id": "error-stack-parser@2.0.6",
"_from": "error-stack-parser@2.1.4",
"_id": "error-stack-parser@2.1.4",
"_inBundle": false,
"_integrity": "sha512-d51brTeqC+BHlwF0BhPtcYgF5nlzf9ZZ0ZIUQNZpc9ZB9qw5IJ2diTrBY9jlCJkTLITYPjmiX6OWCwH+fuyNgQ==",
"_integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==",
"_location": "/error-stack-parser",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "error-stack-parser@2.0.6",
"raw": "error-stack-parser@2.1.4",
"name": "error-stack-parser",
"escapedName": "error-stack-parser",
"rawSpec": "2.0.6",
"rawSpec": "2.1.4",
"saveSpec": null,
"fetchSpec": "2.0.6"
"fetchSpec": "2.1.4"
},
"_requiredBy": [
"/@nuxt/friendly-errors-webpack-plugin"
],
"_resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.0.6.tgz",
"_spec": "2.0.6",
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
"_resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz",
"_spec": "2.1.4",
"_where": "/home/node/nuxt",
"bugs": {
"url": "https://github.com/stacktracejs/error-stack-parser/issues"
},
"dependencies": {
"stackframe": "^1.1.1"
"stackframe": "^1.3.4"
},
"description": "Extract meaning from JS Errors",
"devDependencies": {
"eslint": "^6.8.0",
"jasmine": "^3.5.0",
"jasmine-core": "^3.5.0",
"karma": "^4.4.1",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^2.0.1",
"eslint": "^8.17.0",
"jasmine": "^4.1.0",
"jasmine-core": "^4.1.1",
"karma": "^6.3.20",
"karma-chrome-launcher": "^3.1.1",
"karma-coverage": "^2.2.0",
"karma-coveralls": "^2.1.0",
"karma-firefox-launcher": "^1.2.0",
"karma-firefox-launcher": "^2.1.2",
"karma-ie-launcher": "^1.0.0",
"karma-jasmine": "^1.1.2",
"karma-jasmine": "^4.0.2",
"karma-opera-launcher": "^1.0.0",
"karma-phantomjs-launcher": "^1.0.4",
"karma-safari-launcher": "^1.0.0",
"karma-sauce-launcher": "^2.0.2",
"karma-spec-reporter": "0.0.32",
"karma-sauce-launcher": "^4.3.6",
"karma-spec-reporter": "^0.0.34",
"uglify-es": "^3.3.9"
},
"files": [
@@ -98,8 +98,8 @@
"prepare": "cp error-stack-parser.js dist/ && uglifyjs node_modules/stackframe/stackframe.js error-stack-parser.js -o dist/error-stack-parser.min.js --compress --mangle --source-map \"url=error-stack-parser.min.js.map\"",
"test": "karma start karma.conf.js --single-run",
"test-ci": "karma start karma.conf.ci.js --single-run",
"test-pr": "karma start karma.conf.js --single-run --browsers Firefox,Chrome_Travis"
"test-pr": "karma start karma.conf.js --single-run --browsers Firefox,Chrome_No_Sandbox"
},
"typings": "./error-stack-parser.d.ts",
"version": "2.0.6"
"version": "2.1.4"
}