Skip to content

Commit 72a5c5c

Browse files
committedFeb 20, 2024
chore: update readme
1 parent d0a83f9 commit 72a5c5c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed
 

‎README.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ const obj = destr<MyInterface>("{}"); // obj is well-typed
5656

5757
### ✅ Fast fallback to input if is not string
5858

59-
> 🚀 Up to 500 times faster than `JSON.parse`!
60-
6159
```js
6260
// Uncaught SyntaxError: Unexpected token u in JSON at position 0
6361
JSON.parse();
@@ -68,8 +66,6 @@ destr();
6866

6967
### ✅ Fast lookup for known string values
7068

71-
> 🚀 Up to 900 times faster than `JSON.parse`!
72-
7369
```js
7470
// Uncaught SyntaxError: Unexpected token T in JSON at position 0
7571
JSON.parse("TRUE");
@@ -80,8 +76,6 @@ destr("TRUE");
8076

8177
### ✅ Fallback to original value if parse fails (empty or any plain string)
8278

83-
> 🚀 Up to 900 times faster than `JSON.parse`!
84-
8579
```js
8680
// Uncaught SyntaxError: Unexpected token s in JSON at position 0
8781
JSON.parse("salam");
@@ -118,9 +112,9 @@ safeDestr("[foo");
118112

119113
## Benchmarks
120114

121-
`destr` is sometimes little bit slower than `JSON.parse` when parsing a valid JSON string mainly because of transform to avoid [prototype pollution](https://learn.snyk.io/lessons/prototype-pollution/javascript/) which can lead to serious security issues if not being sanitized. In the other words, `destr` is better when input is not always a JSON string or from untrusted source like request body.
115+
`destr` is faster generally for arbitrary inputs but also sometimes little bit slower than `JSON.parse` when parsing a valid JSON string mainly because of transform to avoid [prototype pollution](https://learn.snyk.io/lessons/prototype-pollution/javascript/) which can lead to serious security issues if not being sanitized. In the other words, `destr` is better when input is not always a JSON string or from untrusted source like request body.
122116

123-
Check [Benchmarks](./BENCH.md)
117+
Check [Benchmark Results](./BENCH.md) or run with `pnpm run bench:node` or `pnpm run bench:bun` yourself!
124118

125119
## License
126120

0 commit comments

Comments
 (0)
Please sign in to comment.