error-stack-parser-es
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -0,16 +1,8 @@ | ||
import { ParseOptions, StackFrame } from './lite.js'; | ||
export { StackFrameLite, extractLocation } from './lite.js'; | ||
/** | ||
* Port from https://github.com/stacktracejs/error-stack-parser-es | ||
* Port from https://github.com/stacktracejs/error-stack-parser | ||
*/ | ||
interface StackFrame { | ||
args?: any[]; | ||
isConstructor?: boolean; | ||
isEval?: boolean; | ||
isNative?: boolean; | ||
isToplevel?: boolean; | ||
columnNumber?: number; | ||
lineNumber?: number; | ||
fileName?: string; | ||
functionName?: string; | ||
source?: string; | ||
} | ||
/** | ||
@@ -22,4 +14,3 @@ * Given an Error object, extract the most information from it. | ||
*/ | ||
declare function parse(error: Error): StackFrame[]; | ||
declare function extractLocation(urlLike: string): string[] | readonly [string, string | undefined, string | undefined]; | ||
declare function parse(error: Error, options?: ParseOptions): StackFrame[]; | ||
declare function parseV8OrIE(error: Error): StackFrame[]; | ||
@@ -32,2 +23,2 @@ declare function parseFFOrSafari(error: Error): StackFrame[]; | ||
export { type StackFrame, extractLocation, parse, parseFFOrSafari, parseOpera, parseOpera10, parseOpera11, parseOpera9, parseV8OrIE }; | ||
export { ParseOptions, StackFrame, parse, parseFFOrSafari, parseOpera, parseOpera10, parseOpera11, parseOpera9, parseV8OrIE }; |
{ | ||
"name": "error-stack-parser-es", | ||
"type": "module", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"packageManager": "pnpm@9.1.1", | ||
@@ -29,2 +29,7 @@ "description": "Cross-browser Error parser", | ||
"require": "./dist/index.cjs" | ||
}, | ||
"./lite": { | ||
"types": "./dist/lite.d.ts", | ||
"import": "./dist/lite.mjs", | ||
"require": "./dist/lite.cjs" | ||
} | ||
@@ -31,0 +36,0 @@ }, |
@@ -17,2 +17,13 @@ # error-stack-parser-es | ||
### Lite API | ||
Additionally, this fork added a lite version of the API representation for the stack frames. You can import it from `error-stack-parser-es/lite`. For example, `line` and `col` instead of `lineNumber` and `columnNumber`. | ||
```ts | ||
import { parse } from 'error-stack-parser-es/lite' | ||
const stacktrace = parse(new Error('BOOM!')) | ||
// [{ file: 'file.js', name: 'method', line: 1, col: 2}] | ||
``` | ||
## License | ||
@@ -19,0 +30,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26200
13
458
32
1