@stackline/stable-stringify 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +10 -0
- package/dist/index.cjs +5 -9
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +5 -9
- package/dist/index.js.map +2 -2
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +3 -3
- package/docs/ADOPTION.md +37 -0
- package/docs/ARCHITECTURE.md +103 -0
- package/docs/BENCHMARKS.md +25 -0
- package/docs/COMPATIBILITY.md +79 -0
- package/docs/MARKET_RESEARCH.md +100 -0
- package/docs/RELEASING.md +68 -0
- package/examples/cache-key.mjs +12 -0
- package/examples/content-digest.mjs +17 -0
- package/examples/safe-logging.mjs +14 -0
- package/package.json +5 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
|
|
3
|
+
import { safeStringify } from '@stackline/stable-stringify';
|
|
4
|
+
|
|
5
|
+
const event = { id: 42n, name: 'checkout.failed' };
|
|
6
|
+
event.context = event;
|
|
7
|
+
|
|
8
|
+
const output = safeStringify(event);
|
|
9
|
+
|
|
10
|
+
assert.equal(
|
|
11
|
+
output,
|
|
12
|
+
'{"context":"[Circular]","id":"42","name":"checkout.failed"}'
|
|
13
|
+
);
|
|
14
|
+
console.log(output);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackline/stable-stringify",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Deterministic, cycle-aware JSON serialization with a fast-json-stable-stringify-compatible API and RFC 8785 canonicalization",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"stable-stringify",
|
|
@@ -62,6 +62,8 @@
|
|
|
62
62
|
},
|
|
63
63
|
"files": [
|
|
64
64
|
"dist",
|
|
65
|
+
"docs",
|
|
66
|
+
"examples",
|
|
65
67
|
"CHANGELOG.md",
|
|
66
68
|
"CONTRIBUTING.md",
|
|
67
69
|
"LICENSE",
|
|
@@ -76,10 +78,11 @@
|
|
|
76
78
|
"clean": "node scripts/clean.mjs",
|
|
77
79
|
"build": "node scripts/build.mjs",
|
|
78
80
|
"lint": "eslint . && node scripts/check-markdown.mjs",
|
|
79
|
-
"test": "npm run build && npm run lint && npm run test:coverage && npm run test:types && npm run test:package && npm run test:install && npm run test:docs",
|
|
81
|
+
"test": "npm run build && npm run lint && npm run test:coverage && npm run test:types && npm run test:examples && npm run test:package && npm run test:install && npm run test:docs",
|
|
80
82
|
"test:unit": "node --test --test-reporter=spec test/*.test.mjs",
|
|
81
83
|
"test:coverage": "c8 --all --src src --check-coverage --lines 100 --functions 100 --statements 100 --branches 95 node --test test/core.test.mjs test/compatibility.test.mjs test/cycles-limits.test.mjs test/canonical.test.mjs test/safe.test.mjs",
|
|
82
84
|
"test:types": "node scripts/test-types.mjs",
|
|
85
|
+
"test:examples": "node examples/cache-key.mjs && node examples/content-digest.mjs && node examples/safe-logging.mjs",
|
|
83
86
|
"test:package": "node --test test/package.test.mjs && node scripts/check-dist.mjs && publint",
|
|
84
87
|
"test:install": "node scripts/smoke-install.mjs",
|
|
85
88
|
"test:docs": "npm run docs:build && node scripts/check-docs.mjs",
|