-
Notifications
You must be signed in to change notification settings - Fork 623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(yaml): fix Boolean object handling #5876
fix(yaml): fix Boolean object handling #5876
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5876 +/- ##
=======================================
Coverage 96.34% 96.35%
=======================================
Files 479 479
Lines 38674 38673 -1
Branches 5631 5630 -1
=======================================
+ Hits 37260 37262 +2
+ Misses 1370 1367 -3
Partials 44 44 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kt3k, PTAL at the related issue. Do you agree this is a fix? I think it is as it fixes expected behavior.
This changes the result of I think we should fix |
The problem is that this special treats the stringify({ foo: new String("foo") }) which returns foo:
'0': f
'1': o
'2': o and stringify({ foo: new Number(1) }) which returns foo: {} |
Tbh, I don't know if we should special treat these cases as they should be discouraged anyway. |
Those examples also seem bugs to me.
import * as yaml from "npm:js-yaml";
console.log(yaml.dump({ foo: new String("foo") }));
console.log(yaml.dump({ foo: new Number(1) })); |
Looks like those handlings of import { stringify } from "https://deno.land/[email protected]/yaml/mod.ts";
console.log(stringify({ foo: new String("foo") }));
console.log(stringify({ foo: new Number(1) })); This prints:
|
Closing in favour of #5894 |
Closes #5857