Skip to content

Commit

Permalink
solana-labs#2405: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrushi20 committed Apr 15, 2024
1 parent 7f195b3 commit fd83386
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
24 changes: 16 additions & 8 deletions packages/fast-stable-stringify/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# fast-stable-stringify

_Notice: The License of this repository has been changed from GPL-3.0 to MIT as of 2017-08-25. All following commits will fall under the MIT license._
This project is a fork of [nickyout/fast-stable-stringify](https://github.com/nickyout/fast-stable-stringify)

The most popular repository providing this feature is [substack's json-stable-stringify][sub]. The intent if this library is to provide a faster alternative for when performance is more important than features. It assumes you provide basic javascript values without circular references, and returns a non-indented string.
The most popular repository providing this feature is [substack's json-stable-stringify](https://www.npmjs.com/package/json-stable-stringify). The intent if this library is to provide a faster alternative for when performance is more important than features. It assumes you provide basic javascript values without circular references, and returns a non-indented string.

Usage:

Expand All @@ -11,15 +11,23 @@ var stringify = require('fast-stable-stringify');
stringify({ d: 0, c: 1, a: 2, b: 3, e: 4 }); // '{"a":2,"b":3,"c":1,"d":0,"e":4}'
```

### Features
Just like substack's, it does:

- handle all variations of all basic javascript values (number, string, boolean, array, object, null, Date, BigInt)
- handle undefined _and_ function in the same way as `JSON.stringify`
* handle all variations of all basic javascript values (number, string, boolean, array, object, null, Date, BigInt)
* handle undefined _and_ function in the same way as `JSON.stringify`
* **not support ie8 (and below) with complete certainty**.

## Running tests
Unlike substack's, it does:

It runs tests using mocha. For testing in node, do:
* not implement the 'replacer' or 'space' arguments of the JSON.stringify method
* not check for circular references


## Running tests

```
npm test
npm run test:unit:browser
npm run test:unit:node
```

_Notice: The License of this repository has been changed from GPL-3.0 to MIT as of 2017-08-25. All following commits will fall under the MIT license._
4 changes: 2 additions & 2 deletions packages/rpc-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
"dependencies": {
"@graphql-tools/schema": "^10.0.3",
"@solana/codecs-strings": "workspace:*",
"@solana/fast-stable-stringify": "workspace:*",
"dataloader": "^2.2.2",
"graphql": "^16.8.0",
"@solana/fast-stable-stringify": "workspace:*"
"graphql": "^16.8.0"
},
"devDependencies": {
"@solana/addresses": "workspace:*",
Expand Down

0 comments on commit fd83386

Please sign in to comment.