fix(NODE-7436): EJSON.stringify type signature#870
Open
chdanielmueller wants to merge 4 commits intomongodb:mainfrom
Open
fix(NODE-7436): EJSON.stringify type signature#870chdanielmueller wants to merge 4 commits intomongodb:mainfrom
chdanielmueller wants to merge 4 commits intomongodb:mainfrom
Conversation
Contributor
|
@chdanielmueller , thanks so much for your contribution! The team is going to prioritize this PR and NODE-7436 at our next triage session. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary of Changes
This pull request enhances the flexibility and robustness of the
EJSON.stringifyfunction by supporting multiple parameter signature combinations, similar toJSON.stringify.It introduces a new internal type guard to accurately distinguish between options and replacer parameters, and adds comprehensive tests to ensure correct behavior across all supported overloads.
It supports a previously advertised function signature which was not implemented.
EJSON.stringify(object, { relaxed: false }, 2)Notes for Reviewers
The tests should contain every previously possible and also previously advertised but not working combination of inputs.
The changes within the function have to do with the previous typescript signature which has been used but did not work. See
js-bson/test/bench/etc/generate_documents.ts
Line 27 in 0712bb1
Off Topic: Documented within NODE-7437
Release Highlight
Release notes highlight
Double check the following
npm run check:lint)type(NODE-xxxx)[!]: descriptionfeat(NODE-1234)!: rewriting everything in coffeescript