fix: make inspection result of Binary evaluatable NODE-2947#416
Merged
nbbeeken merged 3 commits intomongodb:masterfrom Dec 4, 2020
Merged
fix: make inspection result of Binary evaluatable NODE-2947#416nbbeeken merged 3 commits intomongodb:masterfrom
nbbeeken merged 3 commits intomongodb:masterfrom
Conversation
Make sure that evaluating the inspection result of a `Binary` object returns a result that can be evaluated to give an object equivalent to the original.
emadum
approved these changes
Dec 4, 2020
nbbeeken
requested changes
Dec 4, 2020
Contributor
There was a problem hiding this comment.
Thanks for this! it makes sense that the inspect prints should be "round-trippable" so to speak for debugging.
Sorry to increase scope on you but would you mind adding Decimal128 to this fix?
currently it outputs:
> BSON.Decimal128.fromString('12345')
Decimal128('12345')
// But the constructor takes a sequence of bytes not a string:
> Decimal128('12345')
Decimal128("2.1542142465E-6166") // bad valueIt should have the fromString() call on the end instead.
Would it also make sense to add new to the beginning of the inspect strings?
Contributor
Author
|
@nbbeeken Sure, done!
Well, yes, but I also didn't want to increase the scope here too much. Also done! :) |
nbbeeken
approved these changes
Dec 4, 2020
Contributor
nbbeeken
left a comment
There was a problem hiding this comment.
LGTM, I'll merge when we get the ✅ :)
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.
Make sure that evaluating the inspection result of a
Binaryobjectreturns a result that can be evaluated to give an object equivalent
to the original.