@cqrs-ddd/safe-stringify 0.3.0 → 0.4.1
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/README.md +2 -145
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -23
- package/dist/index.js.map +1 -1
- package/dist/key-segment.js +4 -9
- package/dist/key-segment.js.map +1 -1
- package/dist/safeStringify.js +6 -12
- package/dist/safeStringify.js.map +1 -1
- package/dist/stableStringify.js +2 -6
- package/dist/stableStringify.js.map +1 -1
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -3,16 +3,7 @@
|
|
|
3
3
|
Two JSON serializers with opposite goals, and the key-segment helpers that build
|
|
4
4
|
identity keys. No runtime dependencies and no framework.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
| --- | --- | --- |
|
|
8
|
-
| Use for | identity: cache keys, idempotency fingerprints, stored snapshots | display: logs, audit and dead-letter payloads |
|
|
9
|
-
| Output | deterministic JSON, object keys sorted at every level, stable across releases | readable JSON in insertion order; the format may evolve |
|
|
10
|
-
| Unsupported input | throws a `TypeError` | never throws |
|
|
11
|
-
| Secrets | never redacts, because a key must not change | excludes and redacts on request |
|
|
12
|
-
|
|
13
|
-
**Use the strict serializer for anything that identifies data. Never use `safeStringify`
|
|
14
|
-
for a key or a fingerprint:** its output is not sorted, it replaces values it cannot
|
|
15
|
-
represent, and its format may change.
|
|
6
|
+
**Documentation:** [guide](https://aristoteliss.github.io/nestjs-pipeline/packages/cqrs-ddd/safe-stringify/) · [API reference](https://aristoteliss.github.io/nestjs-pipeline/api/cqrs-ddd/safe-stringify/) · [all packages](https://aristoteliss.github.io/nestjs-pipeline/)
|
|
16
7
|
|
|
17
8
|
## Installation
|
|
18
9
|
|
|
@@ -24,141 +15,7 @@ pnpm add @cqrs-ddd/safe-stringify
|
|
|
24
15
|
|
|
25
16
|
Requires Node.js 22.12 or later.
|
|
26
17
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
```typescript
|
|
30
|
-
import { stableStringify, toStrictJsonValue } from '@cqrs-ddd/safe-stringify';
|
|
31
|
-
|
|
32
|
-
stableStringify({ z: 1, a: { d: 2, c: new Date(0) } });
|
|
33
|
-
// '{"a":{"c":"1970-01-01T00:00:00.000Z","d":2},"z":1}'
|
|
34
|
-
|
|
35
|
-
toStrictJsonValue({ b: 2, a: 1 }, true); // { a: 1, b: 2 }, a null-prototype object
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
- Strings, booleans, `null` and finite numbers are kept. Dates become ISO-8601 strings.
|
|
39
|
-
An object with `toJSON()` is replaced by what that method returns.
|
|
40
|
-
- Everything else throws a `TypeError`: `undefined`, functions, `bigint`, symbols and
|
|
41
|
-
symbol-keyed properties, non-finite numbers, invalid dates, cycles, sparse arrays,
|
|
42
|
-
`Map`, `Set`, `WeakMap`, `WeakSet`, `Error`, `RegExp`, `Promise`, `ArrayBuffer` and
|
|
43
|
-
typed arrays.
|
|
44
|
-
- `stableStringify` wraps that failure in a `TypeError` whose `cause` is the original.
|
|
45
|
-
- Structurally equal values produce byte-identical strings, whatever their property
|
|
46
|
-
insertion order. Keys sort by UTF-16 code unit, as `Array.prototype.sort` does.
|
|
47
|
-
|
|
48
|
-
## Safe serializer
|
|
49
|
-
|
|
50
|
-
```typescript
|
|
51
|
-
import {
|
|
52
|
-
DEFAULT_REDACT_KEYS,
|
|
53
|
-
redactValue,
|
|
54
|
-
safeStringify,
|
|
55
|
-
} from '@cqrs-ddd/safe-stringify';
|
|
56
|
-
|
|
57
|
-
const payload: Record<string, unknown> = { user: 'jane', password: 'secret', amount: 10n };
|
|
58
|
-
payload.self = payload;
|
|
59
|
-
|
|
60
|
-
safeStringify(payload);
|
|
61
|
-
// '{"user":"jane","password":"secret","amount":"[bigint]","self":"[Circular]"}'
|
|
62
|
-
|
|
63
|
-
safeStringify(payload, { redactKeys: DEFAULT_REDACT_KEYS });
|
|
64
|
-
// '{"user":"jane","password":"[REDACTED]","amount":"[bigint]","self":"[Circular]"}'
|
|
65
|
-
|
|
66
|
-
redactValue(payload); // a deep clone with DEFAULT_REDACT_KEYS masked
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
- `safeStringify(value, options?, indent?)` and `safeSanitize(value, options?)` never
|
|
70
|
-
throw. Cycles become `"[Circular]"`, errors are expanded to `name`, `message`, `stack`
|
|
71
|
-
and their own enumerable properties, and values JSON cannot hold are replaced by a
|
|
72
|
-
readable marker (`"[bigint]"`, `"[Function]"`, `"[Invalid Date]"`, `"[Binary Data]"`,
|
|
73
|
-
`"[Stream]"`). A `Set<string>` in place of `options` is read as `excludeKeys`.
|
|
74
|
-
`safeStringify(undefined)` returns the string `'undefined'`.
|
|
75
|
-
- **They redact nothing unless you pass `redactKeys`.** `redactValue(value, keys?)`
|
|
76
|
-
applies `DEFAULT_REDACT_KEYS` by default and keeps rich types (`mode: 'clone'`).
|
|
77
|
-
- `SanitizeOptions`:
|
|
78
|
-
|
|
79
|
-
| Option | Effect |
|
|
80
|
-
| --- | --- |
|
|
81
|
-
| `excludeKeys` | keys or dot-paths removed from the output; exact, case-sensitive match |
|
|
82
|
-
| `redactKeys` | keys or dot-paths masked; matched ignoring case, `_` and `-`, so `refreshToken` also masks `refresh_token` |
|
|
83
|
-
| `redactReplacement` | the mask; default `REDACTED` (`"[REDACTED]"`) |
|
|
84
|
-
| `mode` | `'json'` (default) turns rich types into JSON-friendly values; `'clone'` deep-clones them keeping their classes |
|
|
85
|
-
|
|
86
|
-
- Exclusion and redaction, with a key matched at any depth or a dot-path matched at one
|
|
87
|
-
place only:
|
|
88
|
-
|
|
89
|
-
```typescript
|
|
90
|
-
safeStringify(
|
|
91
|
-
{ user: { profile: { email: 'x' }, token: 't' } },
|
|
92
|
-
{ excludeKeys: ['user.profile'], redactKeys: ['token'], redactReplacement: '***' },
|
|
93
|
-
);
|
|
94
|
-
// '{"user":{"token":"***"}}'
|
|
95
|
-
|
|
96
|
-
safeStringify({ when: new Date(0), tags: new Set(['a']), limits: new Map([['k', 1]]) });
|
|
97
|
-
// '{"when":"1970-01-01T00:00:00.000Z","tags":["a"],"limits":{"k":1}}'
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
- `DEFAULT_REDACT_KEYS` lists common secret names (passwords, tokens, API keys,
|
|
101
|
-
authorization headers, cookies, card data). No list recognizes every secret: add your
|
|
102
|
-
application's own names.
|
|
103
|
-
|
|
104
|
-
## Key segments
|
|
105
|
-
|
|
106
|
-
```typescript
|
|
107
|
-
import {
|
|
108
|
-
ABSENT_SEGMENT,
|
|
109
|
-
escapeKeySegment,
|
|
110
|
-
joinKeySegments,
|
|
111
|
-
} from '@cqrs-ddd/safe-stringify';
|
|
112
|
-
|
|
113
|
-
joinKeySegments(['cache', 'tenant:a', undefined, 'user']);
|
|
114
|
-
// 'cache:tenant\\:a:\\-:user'
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
- `joinKeySegments(segments)` escapes each segment and joins them with `:`.
|
|
118
|
-
`undefined` and `null` become `ABSENT_SEGMENT` (`\-`), so `['a', undefined]` and
|
|
119
|
-
`['a', '']` produce different keys.
|
|
120
|
-
- `escapeKeySegment(value)` escapes `\` first, then `:`. A segment that is literally
|
|
121
|
-
`\-` is written `\\-`, so it never collides with an absent segment.
|
|
122
|
-
|
|
123
|
-
Build a cache key from a tenant, a request name and a strict fingerprint of the payload:
|
|
124
|
-
|
|
125
|
-
```typescript
|
|
126
|
-
import { joinKeySegments, stableStringify } from '@cqrs-ddd/safe-stringify';
|
|
127
|
-
import { createHash } from 'node:crypto';
|
|
128
|
-
|
|
129
|
-
function cacheKey(tenantId: string | undefined, name: string, payload: unknown): string {
|
|
130
|
-
const fingerprint = createHash('sha256').update(stableStringify(payload)).digest('hex');
|
|
131
|
-
return joinKeySegments(['cache', tenantId, name, fingerprint]);
|
|
132
|
-
}
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
The strict serializer's output and these key formats are part of the package contract:
|
|
136
|
-
changing them would orphan every stored cache entry, rate-limit bucket and idempotency
|
|
137
|
-
fingerprint. The package's golden-output specs pin them.
|
|
138
|
-
|
|
139
|
-
## Migrating from @nestjs-pipeline/core 0.1.x
|
|
140
|
-
|
|
141
|
-
`@nestjs-pipeline/core` 0.1.x did not export any serializer or key-segment helper from its
|
|
142
|
-
entry point: `safeStringify` and `safeSanitize` lived in its internal
|
|
143
|
-
`dist/helpers/safeStringify` module, and `stableStringify`, `toStrictJsonValue`,
|
|
144
|
-
`redactValue`, `DEFAULT_REDACT_KEYS`, `REDACTED` and the key-segment helpers did not exist.
|
|
145
|
-
Code that deep-imported the internal module moves to this package:
|
|
146
|
-
|
|
147
|
-
```typescript
|
|
148
|
-
// Before (0.1.x, an internal path)
|
|
149
|
-
import { safeSanitize, safeStringify } from '@nestjs-pipeline/core/dist/helpers/safeStringify';
|
|
150
|
-
|
|
151
|
-
safeStringify(value, new Set(['token', 'ctx.sessionUser']), 2);
|
|
152
|
-
|
|
153
|
-
// After (0.2.0)
|
|
154
|
-
import { safeSanitize, safeStringify } from '@cqrs-ddd/safe-stringify';
|
|
155
|
-
|
|
156
|
-
safeStringify(value, { excludeKeys: ['token', 'ctx.sessionUser'] }, 2);
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
- The `Set<string>` second argument is still accepted and means `excludeKeys`.
|
|
160
|
-
- `safeStringify(undefined)` now returns `'undefined'` instead of `undefined`.
|
|
161
|
-
- Use `stableStringify`, not `safeStringify`, for any key or fingerprint you build.
|
|
18
|
+
Published as an ES module; a CommonJS application loads it with `require()`. Coming from 0.3.x, see [Upgrading from 0.3.x](https://aristoteliss.github.io/nestjs-pipeline/upgrading/from-0-3/).
|
|
162
19
|
|
|
163
20
|
## License
|
|
164
21
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ABSENT_SEGMENT, escapeKeySegment, joinKeySegments, } from './key-segment';
|
|
2
|
-
export * from './safeStringify';
|
|
3
|
-
export * from './stableStringify';
|
|
1
|
+
export { ABSENT_SEGMENT, escapeKeySegment, joinKeySegments, } from './key-segment.js';
|
|
2
|
+
export * from './safeStringify.js';
|
|
3
|
+
export * from './stableStringify.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,eAAe,GAChB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,25 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* Copyright (C) 2026-present Aristotelis — see repository license. */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.joinKeySegments = exports.escapeKeySegment = exports.ABSENT_SEGMENT = void 0;
|
|
19
|
-
var key_segment_1 = require("./key-segment");
|
|
20
|
-
Object.defineProperty(exports, "ABSENT_SEGMENT", { enumerable: true, get: function () { return key_segment_1.ABSENT_SEGMENT; } });
|
|
21
|
-
Object.defineProperty(exports, "escapeKeySegment", { enumerable: true, get: function () { return key_segment_1.escapeKeySegment; } });
|
|
22
|
-
Object.defineProperty(exports, "joinKeySegments", { enumerable: true, get: function () { return key_segment_1.joinKeySegments; } });
|
|
23
|
-
__exportStar(require("./safeStringify"), exports);
|
|
24
|
-
__exportStar(require("./stableStringify"), exports);
|
|
2
|
+
export { ABSENT_SEGMENT, escapeKeySegment, joinKeySegments, } from './key-segment.js';
|
|
3
|
+
export * from './safeStringify.js';
|
|
4
|
+
export * from './stableStringify.js';
|
|
25
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|
package/dist/key-segment.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* Copyright (C) 2026-present Aristotelis — see repository license. */
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.ABSENT_SEGMENT = void 0;
|
|
5
|
-
exports.escapeKeySegment = escapeKeySegment;
|
|
6
|
-
exports.joinKeySegments = joinKeySegments;
|
|
7
2
|
/** Character that separates the segments of a composite key. */
|
|
8
3
|
const SEGMENT_SEPARATOR = ':';
|
|
9
4
|
/**
|
|
@@ -14,7 +9,7 @@ const SEGMENT_SEPARATOR = ':';
|
|
|
14
9
|
* value only ever produces `\\` or `\:`, so no genuine segment can render as
|
|
15
10
|
* `\-`, and a literal `\-` inside a value escapes to `\\-`.
|
|
16
11
|
*/
|
|
17
|
-
|
|
12
|
+
export const ABSENT_SEGMENT = '\\-';
|
|
18
13
|
/**
|
|
19
14
|
* Escapes the structural characters of a `:`-joined composite key.
|
|
20
15
|
*
|
|
@@ -33,7 +28,7 @@ exports.ABSENT_SEGMENT = '\\-';
|
|
|
33
28
|
* The backslash is escaped first so that an input already containing one cannot
|
|
34
29
|
* be used to forge a separator.
|
|
35
30
|
*/
|
|
36
|
-
function escapeKeySegment(value) {
|
|
31
|
+
export function escapeKeySegment(value) {
|
|
37
32
|
return value.replace(/\\/g, '\\\\').replace(/:/g, '\\:');
|
|
38
33
|
}
|
|
39
34
|
/**
|
|
@@ -44,10 +39,10 @@ function escapeKeySegment(value) {
|
|
|
44
39
|
* had that position at all. Omitting an absent tenant, for example, would make a
|
|
45
40
|
* tenant-less key identical to the key of a single-tenant deployment.
|
|
46
41
|
*/
|
|
47
|
-
function joinKeySegments(segments) {
|
|
42
|
+
export function joinKeySegments(segments) {
|
|
48
43
|
return segments
|
|
49
44
|
.map((segment) => segment === undefined || segment === null
|
|
50
|
-
?
|
|
45
|
+
? ABSENT_SEGMENT
|
|
51
46
|
: escapeKeySegment(segment))
|
|
52
47
|
.join(SEGMENT_SEPARATOR);
|
|
53
48
|
}
|
package/dist/key-segment.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-segment.js","sourceRoot":"","sources":["../src/key-segment.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"key-segment.js","sourceRoot":"","sources":["../src/key-segment.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,gEAAgE;AAChE,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC;AAEpC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC7B,QAAgD;IAEhD,OAAO,QAAQ;SACZ,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CACf,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI;QACvC,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAC9B;SACA,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAC7B,CAAC"}
|
package/dist/safeStringify.js
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* Copyright (C) 2026-present Aristotelis — see repository license. */
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.DEFAULT_REDACT_KEYS = exports.REDACTED = void 0;
|
|
5
|
-
exports.safeSanitize = safeSanitize;
|
|
6
|
-
exports.safeStringify = safeStringify;
|
|
7
|
-
exports.redactValue = redactValue;
|
|
8
2
|
/** Placeholder substituted for the value of a redacted field. */
|
|
9
|
-
|
|
3
|
+
export const REDACTED = '[REDACTED]';
|
|
10
4
|
/**
|
|
11
5
|
* Commonly sensitive field names. Redaction matches a key ignoring case, `_`
|
|
12
6
|
* and `-`, so `refreshToken` also masks `refresh_token` and `REFRESH-TOKEN`;
|
|
13
7
|
* a name list cannot recognize every secret, so add application-specific
|
|
14
8
|
* names through `redactKeys`.
|
|
15
9
|
*/
|
|
16
|
-
|
|
10
|
+
export const DEFAULT_REDACT_KEYS = [
|
|
17
11
|
'password',
|
|
18
12
|
'passwordHash',
|
|
19
13
|
'pass',
|
|
@@ -43,7 +37,7 @@ function buildMatchers(options) {
|
|
|
43
37
|
const pathExclude = new Set();
|
|
44
38
|
const flatRedact = new Set();
|
|
45
39
|
const pathRedact = new Set();
|
|
46
|
-
let redactReplacement =
|
|
40
|
+
let redactReplacement = REDACTED;
|
|
47
41
|
let mode = 'json';
|
|
48
42
|
if (options instanceof Set)
|
|
49
43
|
options = { excludeKeys: options };
|
|
@@ -228,7 +222,7 @@ function copyProperties(source, target, path, matchers, ancestors) {
|
|
|
228
222
|
* Sanitizes a value for structured logging or general processing: handles
|
|
229
223
|
* circular references, non-serializable types, exclusion, and redaction.
|
|
230
224
|
*/
|
|
231
|
-
function safeSanitize(value, options) {
|
|
225
|
+
export function safeSanitize(value, options) {
|
|
232
226
|
const matchers = buildMatchers(options);
|
|
233
227
|
return sanitizeValue(value, '', matchers, new WeakSet());
|
|
234
228
|
}
|
|
@@ -236,7 +230,7 @@ function safeSanitize(value, options) {
|
|
|
236
230
|
* Safely converts a value to a JSON string, handling circular references,
|
|
237
231
|
* non-serializable types, and optional key exclusion/redaction.
|
|
238
232
|
*/
|
|
239
|
-
function safeStringify(value, options, indent) {
|
|
233
|
+
export function safeStringify(value, options, indent) {
|
|
240
234
|
const sanitized = safeSanitize(value, options);
|
|
241
235
|
return JSON.stringify(sanitized, undefined, indent) ?? 'undefined';
|
|
242
236
|
}
|
|
@@ -250,7 +244,7 @@ function safeStringify(value, options, indent) {
|
|
|
250
244
|
* streams and Multer files become placeholder strings, and functions are
|
|
251
245
|
* returned by reference.
|
|
252
246
|
*/
|
|
253
|
-
function redactValue(value, keys =
|
|
247
|
+
export function redactValue(value, keys = DEFAULT_REDACT_KEYS) {
|
|
254
248
|
return safeSanitize(value, {
|
|
255
249
|
redactKeys: keys,
|
|
256
250
|
mode: 'clone',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safeStringify.js","sourceRoot":"","sources":["../src/safeStringify.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"safeStringify.js","sourceRoot":"","sources":["../src/safeStringify.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,iEAAiE;AACjE,MAAM,CAAC,MAA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,aAAa,CAC3B,KAAc,EACd,OAAuC,EACvC,MAAe;IAEf,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,WAAW,CAAC;AACrE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CACzB,KAAc,EACd,IAAI,GAAsB,mBAAmB;IAE7C,OAAO,YAAY,CAAC,KAAK,EAAE;QACzB,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,OAAO;KACd,CAAC,CAAC;AACL,CAAC"}
|
package/dist/stableStringify.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/* Copyright (C) 2026-present Aristotelis — see repository license. */
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.toStrictJsonValue = toStrictJsonValue;
|
|
5
|
-
exports.stableStringify = stableStringify;
|
|
6
2
|
/**
|
|
7
3
|
* Normalizes a value to the strict, portable JSON domain used for deterministic
|
|
8
4
|
* hashing, idempotency fingerprints, and cache key generation.
|
|
@@ -28,7 +24,7 @@ exports.stableStringify = stableStringify;
|
|
|
28
24
|
* // → { a: 1, b: 2 }
|
|
29
25
|
* ```
|
|
30
26
|
*/
|
|
31
|
-
function toStrictJsonValue(value, sortKeys = false) {
|
|
27
|
+
export function toStrictJsonValue(value, sortKeys = false) {
|
|
32
28
|
return normalize(value, new WeakSet(), sortKeys);
|
|
33
29
|
}
|
|
34
30
|
function normalize(value, ancestors, sortKeys) {
|
|
@@ -138,7 +134,7 @@ function isUnsupportedObject(value) {
|
|
|
138
134
|
* // → '{"a":2,"z":1}'
|
|
139
135
|
* ```
|
|
140
136
|
*/
|
|
141
|
-
function stableStringify(value) {
|
|
137
|
+
export function stableStringify(value) {
|
|
142
138
|
try {
|
|
143
139
|
return JSON.stringify(toStrictJsonValue(value, true));
|
|
144
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stableStringify.js","sourceRoot":"","sources":["../src/stableStringify.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stableStringify.js","sourceRoot":"","sources":["../src/stableStringify.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAatE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAc,EACd,QAAQ,GAAG,KAAK;IAEhB,OAAO,SAAS,CAAC,KAAK,EAAE,IAAI,OAAO,EAAU,EAAE,QAAQ,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,SAAS,CAChB,KAAc,EACd,SAA0B,EAC1B,QAAiB;IAEjB,IACE,KAAK,KAAK,IAAI;QACd,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,SAAS,EAC1B,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,SAAS,CAAC,+CAA+C,CAAC,CAAC;QACvE,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,SAAS,CAAC,gCAAgC,OAAO,KAAK,GAAG,CAAC,CAAC;IACvE,CAAC;IAED,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAC;IAClE,CAAC;IAED,IAAI,KAAK,YAAY,IAAI,EAAE,CAAC;QAC1B,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,SAAS,CAAC,0CAA0C,CAAC,C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+1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cqrs-ddd/safe-stringify",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Deterministic JSON for identity (cache keys, fingerprints) and safe, redacting JSON for logs, with no dependencies and no framework.",
|
|
5
5
|
"author": "Aristotelis",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
7
|
+
"type": "module",
|
|
7
8
|
"engines": {
|
|
8
9
|
"node": ">=22.12.0"
|
|
9
10
|
},
|
|
@@ -23,6 +24,13 @@
|
|
|
23
24
|
"redaction",
|
|
24
25
|
"cache-key"
|
|
25
26
|
],
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"default": "./dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./package.json": "./package.json"
|
|
33
|
+
},
|
|
26
34
|
"main": "dist/index.js",
|
|
27
35
|
"types": "dist/index.d.ts",
|
|
28
36
|
"files": [
|