Skip to content

Commit

Permalink
fix: daria suggestion
Browse files Browse the repository at this point in the history
Co-authored-by: Daria Pardue <[email protected]>
  • Loading branch information
nbbeeken and dariakp authored Sep 10, 2024
1 parent bc8567a commit bcd26f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/upgrade-to-v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export type JSONPrimitive = string | number | boolean | null;
export type SerializableTypes = Document | Array<JSONPrimitive | Document> | JSONPrimitive;
```

`SerializableTypes` is removed in v5 due to it inaccuracy and inconvenience when working with return type of `EJSON.parse()`.
`SerializableTypes` is removed in v5 due to its inaccuracy and inconvenience when working with return type of `EJSON.parse()`.
This type does not contain all possible outputs from this function and it cannot be conveniently related to a custom declared type.
`EJSON.parse` and `EJSON.stringify` now accept `any` in alignment with `JSON`'s corresponding APIs.
For users that desire type strictness it is recommended to wrap these APIs with type annotations that take/return `unknown` since that generally forces better narrowing logic than `SerializableTypes` would have prompted.

0 comments on commit bcd26f3

Please sign in to comment.