Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: replace json-stable-stringify with safe-stable-stringify #104

Merged
merged 1 commit into from
Feb 10, 2023
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Replace `fast-stable-stringify` dependency with `safe-stable-stringify`

## [10.0.0]
### Changed
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"eth-block-tracker": "^6.1.0",
"eth-rpc-errors": "^4.0.3",
"json-rpc-engine": "^6.1.0",
"json-stable-stringify": "^1.0.1",
"pify": "^3.0.0"
"pify": "^3.0.0",
"safe-stable-stringify": "^2.3.2"
},
"devDependencies": {
"@jest/globals": "^27.5.1",
Expand All @@ -49,7 +49,6 @@
"@types/btoa": "^1.2.3",
"@types/clone": "^2.1.0",
"@types/jest": "^27.4.1",
"@types/json-stable-stringify": "^1.0.32",
"@types/node": "^17.0.23",
"@types/pify": "^3.0.2",
"@typescript-eslint/eslint-plugin": "^4.21.0",
Expand Down
4 changes: 3 additions & 1 deletion src/utils/cache.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import stringify from 'json-stable-stringify';
import { configure } from 'safe-stable-stringify';
import { JsonRpcRequest } from 'json-rpc-engine';

const stringify = configure({ bigint: false, circularValue: Error });

/**
* The cache strategy to use for a given method.
*/
Expand Down
33 changes: 8 additions & 25 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,6 @@ __metadata:
"@types/btoa": ^1.2.3
"@types/clone": ^2.1.0
"@types/jest": ^27.4.1
"@types/json-stable-stringify": ^1.0.32
"@types/node": ^17.0.23
"@types/pify": ^3.0.2
"@typescript-eslint/eslint-plugin": ^4.21.0
Expand All @@ -878,11 +877,11 @@ __metadata:
eth-rpc-errors: ^4.0.3
jest: ^27.5.1
json-rpc-engine: ^6.1.0
json-stable-stringify: ^1.0.1
pify: ^3.0.0
prettier: ^2.2.1
prettier-plugin-packagejson: ^2.2.11
rimraf: ^3.0.2
safe-stable-stringify: ^2.3.2
ts-jest: ^27.1.4
ts-node: ^10.7.0
typescript: ~4.2.4
Expand Down Expand Up @@ -1226,13 +1225,6 @@ __metadata:
languageName: node
linkType: hard

"@types/json-stable-stringify@npm:^1.0.32":
version: 1.0.34
resolution: "@types/json-stable-stringify@npm:1.0.34"
checksum: 45767ecef0f6aae5680c3be6488d5c493f16046e34f182d7e6a2c69a667aab035799752c6f03017c883b134ad3f80e3f78d7e7da81a9c1f3d01676126baf5d0e
languageName: node
linkType: hard

"@types/json5@npm:^0.0.29":
version: 0.0.29
resolution: "@types/json5@npm:0.0.29"
Expand Down Expand Up @@ -4456,15 +4448,6 @@ __metadata:
languageName: node
linkType: hard

"json-stable-stringify@npm:^1.0.1":
version: 1.0.1
resolution: "json-stable-stringify@npm:1.0.1"
dependencies:
jsonify: ~0.0.0
checksum: 65d6cbf0fca72a4136999f65f4401cf39a129f7aeff0fdd987ac3d3423a2113659294045fb8377e6e20d865cac32b1b8d70f3d87346c9786adcee60661d96ca5
languageName: node
linkType: hard

"json-stringify-safe@npm:~5.0.1":
version: 5.0.1
resolution: "json-stringify-safe@npm:5.0.1"
Expand Down Expand Up @@ -4492,13 +4475,6 @@ __metadata:
languageName: node
linkType: hard

"jsonify@npm:~0.0.0":
version: 0.0.0
resolution: "jsonify@npm:0.0.0"
checksum: d8d4ed476c116e6987a460dcb82f22284686caae9f498ac87b0502c1765ac1522f4f450a4cad4cc368d202fd3b27a3860735140a82867fc6d558f5f199c38bce
languageName: node
linkType: hard

"jsprim@npm:^1.2.2":
version: 1.4.2
resolution: "jsprim@npm:1.4.2"
Expand Down Expand Up @@ -5548,6 +5524,13 @@ __metadata:
languageName: node
linkType: hard

"safe-stable-stringify@npm:^2.3.2":
version: 2.4.2
resolution: "safe-stable-stringify@npm:2.4.2"
checksum: 0324ba2e40f78cae63e31a02b1c9bdf1b786621f9e8760845608eb9e81aef401944ac2078e5c9c1533cf516aea34d08fa8052ca853637ced84b791caaf1e394e
languageName: node
linkType: hard

"safer-buffer@npm:>= 2.1.2 < 3, safer-buffer@npm:>= 2.1.2 < 3.0.0, safer-buffer@npm:^2.0.2, safer-buffer@npm:^2.1.0, safer-buffer@npm:~2.1.0":
version: 2.1.2
resolution: "safer-buffer@npm:2.1.2"
Expand Down