Skip to content

Commit 80b444d

Browse files
committed
feat(3.0): remove fast-json-stringify
1 parent 2f12694 commit 80b444d

File tree

4 files changed

+1
-37
lines changed

4 files changed

+1
-37
lines changed

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"node": ">=18"
4646
},
4747
"dependencies": {
48-
"fast-json-stringify": "6.x",
4948
"prettyoutput": "1.x"
5049
},
5150
"devDependencies": {

src/json_schema.ts

-26
This file was deleted.

src/output_utils.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { ReplacerFunction } from './definitions.js'
2-
import { fastStringifyLog } from './json_schema.js'
32

43
/**
54
* Replace circular reference when used with JSON.stringify
@@ -24,7 +23,7 @@ export const getCircularReplacer = (): ReplacerFunction => {
2423
*/
2524
export const stringifyLog = (log: Record<string, unknown>): string => {
2625
try {
27-
return fastStringifyLog(log)
26+
return JSON.stringify(log)
2827
} catch (e) {
2928
return JSON.stringify(log, getCircularReplacer())
3029
}

test/output_utils.test.ts

-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { describe, expect, it, vi } from 'vitest'
2-
import * as jsonSchema from '../src/json_schema.js'
32
import * as outputUtils from '../src/output_utils.js'
43

54
describe('outputUtils', () => {
@@ -29,16 +28,9 @@ describe('outputUtils', () => {
2928

3029
it('should fallback to standard stringify when fastStringifyLog fails', () => {
3130
const obj = { test: 'value' }
32-
const fastStringifyLogMock = vi
33-
.spyOn(jsonSchema, 'fastStringifyLog')
34-
.mockImplementation(() => {
35-
throw new Error('Mocked error')
36-
})
3731

3832
const result = outputUtils.stringifyLog(obj)
3933
expect(result).toBe('{"test":"value"}')
40-
41-
fastStringifyLogMock.mockRestore()
4234
})
4335
})
4436

0 commit comments

Comments
 (0)