Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Changelog

## Next
## v3.0.1

- Apply `bigint: false` and strict mode to BigInt typed-array entries.
- Report strict-mode errors at their typed-array indices when `safe` is enabled.
- Escape caught error messages in safe mode so quotes, backslashes, and control characters produce valid JSON.

## v3.0.0

- **Breaking change:** Require Node.js 18 or later.
- Fix ESM imports in Node.js and bundlers, including applications that also use CommonJS.
Expand Down
2 changes: 1 addition & 1 deletion esm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "safe-stable-stringify",
"version": "2.5.0",
"version": "3.0.1",
"type": "module",
"main": "./wrapper.mjs",
"exports": "./wrapper.mjs"
Expand Down
2 changes: 1 addition & 1 deletion esm/wrapper.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ const sharedGlobal = /** @type {Record<symbol, typeof import('../index.js').defa
globalThis
)

export const stringify = sharedGlobal[Symbol.for('safe-stable-stringify@3.0.0')]
export const stringify = sharedGlobal[Symbol.for('safe-stable-stringify@3.0.1')]
export const configure = stringify.configure
export default stringify
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ function configure (options) {
const sharedGlobal = /** @type {Record<symbol, typeof import('./index.js').default | undefined>} */ (
globalThis
)
const exportSymbol = Symbol.for('safe-stable-stringify@3.0.0')
const exportSymbol = Symbol.for('safe-stable-stringify@3.0.1')

if (sharedGlobal[exportSymbol] === undefined) {
const stringify = configure()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "safe-stable-stringify",
"version": "3.0.0",
"version": "3.0.1",
"description": "Deterministic and safely JSON.stringify to quickly serialize JavaScript objects",
"exports": {
"types": "./index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test('escaping preserves output across runtime and string length boundaries', (a
const paths = [require.resolve('./index.js'), require.resolve('.')]
const cached = paths.map(path => require.cache[path])
const nativeProcess = globalThis.process
const exportSymbol = Symbol.for('safe-stable-stringify@3.0.0')
const exportSymbol = Symbol.for('safe-stable-stringify@3.0.1')
const descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(globalThis, exportSymbol))
for (const process of [undefined, null, {}, { versions: {} }, { versions: { node: '21.0.0' } }, { versions: { node: '22.0.0' } }, { versions: { node: '26.3.1' } }]) {
let serializer
Expand Down
2 changes: 1 addition & 1 deletion wrapper.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ const sharedGlobal = /** @type {Record<symbol, typeof import('./index.js').defau
globalThis
)

module.exports = sharedGlobal[Symbol.for('safe-stable-stringify@3.0.0')]
module.exports = sharedGlobal[Symbol.for('safe-stable-stringify@3.0.1')]
Loading