Skip to content

Commit

Permalink
updated README and type info with strip null details
Browse files Browse the repository at this point in the history
  • Loading branch information
shivamkj committed Jul 27, 2024
1 parent 5e01a5d commit 8dc2705
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ const stringify = fastJson(mySchema, {
- `rounding`: setup how the `integer` types will be rounded when not integers. [More details](#integer)
- `largeArrayMechanism`: set the mechanism that should be used to handle large
(by default `20000` or more items) arrays. [More details](#largearrays)
- `stripNull`: removes keys with null values from serialised output. If you have lots of null values, using this will result in smallerpayload and improved performance.


<a name="api"></a>
Expand Down
7 changes: 7 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ declare namespace build {
* @default 'default'
*/
largeArrayMechanism?: 'default' | 'json-stringify'

/**
* Specify if null key-value are removed from serialised JSON output, for a smaller payload
*
* @default 'false'
*/
stripNull?: boolean
}

export const validLargeArrayMechanisms: string[]
Expand Down

0 comments on commit 8dc2705

Please sign in to comment.