fast-safe-stringify
Advanced tools
Comparing version 2.0.2 to 2.0.3
declare function stringify(data: any): string; | ||
declare namespace stringify { | ||
export declare function stable(data: any): string; | ||
export declare function stableStringify(data: any): string; | ||
export function stable(data: any): string; | ||
export function stableStringify(data: any): string; | ||
} | ||
export default stringify; |
{ | ||
"name": "fast-safe-stringify", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Safely and quickly serialize JavaScript objects", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -59,2 +59,6 @@ # fast-safe-stringify | ||
A faster and side-effect free implementation is available in the | ||
[safe-stable-stringify][] module. However it is still considered experimental | ||
due to a new and more complex implementation. | ||
## Differences to JSON.stringify | ||
@@ -87,2 +91,7 @@ | ||
A side effect free variation without these limitations can be found as well | ||
([`safe-stable-stringify`][]). It is also faster than the current | ||
implementation. It is still considered experimental due to a new and more | ||
complex implementation. | ||
## Benchmarks | ||
@@ -113,15 +122,5 @@ | ||
Comparing the deterministic `fast-safe-stringify` with known alternatives: | ||
(Running the `fast-json-stable-stringify` [benchmark][]) | ||
For stable stringify comparisons, see the performance benchmarks in the | ||
[`safe-stable-stringify`][] readme. | ||
```md | ||
fast-json-stable-stringify x 15,494 ops/sec ±1.59% (88 runs sampled) | ||
json-stable-stringify x 12,229 ops/sec ±1.32% (89 runs sampled) | ||
fast-stable-stringify x 16,226 ops/sec ±0.65% (92 runs sampled) | ||
faster-stable-stringify x 13,900 ops/sec ±1.05% (90 runs sampled) | ||
fast-safe-stringify x 26,528 ops/sec ±1.40% (91 runs sampled) | ||
The fastest is fast-safe-stringify | ||
``` | ||
## Protip | ||
@@ -154,2 +153,3 @@ | ||
[`replacer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The%20replacer%20parameter | ||
[`safe-stable-stringify`]: https://github.com/BridgeAR/safe-stable-stringify | ||
[`space`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The%20space%20argument | ||
@@ -156,0 +156,0 @@ [`toJSON`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON()_behavior |
26388
10