Skip to content

Commit 1226ec0

Browse files
committed
fix!: rename parseStackTrace to parseRawStackTrace
1 parent 3c5db50 commit 1226ec0

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pnpm install errx
2020
```
2121

2222
```js
23-
import { captureRawStackTrace, captureStackTrace, parseStackTrace } from 'errx'
23+
import { captureRawStackTrace, captureStackTrace, parseRawStackTrace } from 'errx'
2424

2525
// returns raw string stack trace
2626
captureRawStackTrace()

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ export function captureRawStackTrace() {
2323
export function captureStackTrace() {
2424
const stack = captureRawStackTrace()
2525

26-
return stack ? parseStackTrace(stack) : []
26+
return stack ? parseRawStackTrace(stack) : []
2727
}
2828

29-
export function parseStackTrace(stacktrace: string) {
29+
export function parseRawStackTrace(stacktrace: string) {
3030
const trace: ParsedTrace[] = []
3131
for (const line of stacktrace.split('\n')) {
3232
const parsed = LINE_RE.exec(line)?.groups as Partial<Record<keyof ParsedTrace, string>> | undefined

test/index.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { fileURLToPath } from 'node:url'
22
import { describe, expect, it } from 'vitest'
3-
import { captureStackTrace, parseStackTrace } from '../src'
3+
import { captureStackTrace, parseRawStackTrace } from '../src'
44

55
describe('errx', () => {
66
it('works', () => {
@@ -112,15 +112,15 @@ Error
112112

113113
describe('parseStackTrace', () => {
114114
it('parses vitest', () => {
115-
expect(parseStackTrace(vitestTrace)).toMatchFileSnapshot('__snapshots__/vitest.json5')
115+
expect(parseRawStackTrace(vitestTrace)).toMatchFileSnapshot('__snapshots__/vitest.json5')
116116
})
117117
it('parses jiti', () => {
118-
expect(parseStackTrace(jitiTrace)).toMatchFileSnapshot('__snapshots__/jiti.json5')
118+
expect(parseRawStackTrace(jitiTrace)).toMatchFileSnapshot('__snapshots__/jiti.json5')
119119
})
120120
it('parses bun', () => {
121-
expect(parseStackTrace(bunTrace)).toMatchFileSnapshot('__snapshots__/bun.json5')
121+
expect(parseRawStackTrace(bunTrace)).toMatchFileSnapshot('__snapshots__/bun.json5')
122122
})
123123
it('parses deno', () => {
124-
expect(parseStackTrace(denoTrace)).toMatchFileSnapshot('__snapshots__/deno.json5')
124+
expect(parseRawStackTrace(denoTrace)).toMatchFileSnapshot('__snapshots__/deno.json5')
125125
})
126126
})

0 commit comments

Comments
 (0)