Open timreichen opened 2 months ago
Yeah, it seems the predicate should just be value === true || value === false
. I don't see why Boolean
instances should be treated in any special way. I'm not aware of any such treatment elsewhere in the codebase.
I'll open a PR. Would that be breaking or fix?
Describe the bug In
yaml/_types/bool.ts
, booleans are evaluated asThis means
Boolean
instances are handled as booleans in yaml but the representation is evaluated asThis will always stringify
Boolean
instances to"true"
, which is probably not the intended behavior.Steps to Reproduce
Expected behavior
new Boolean(false)
should evaluate to"false"
ORBoolean
instances should not be special treated andvalue instanceof Boolean
removed so they are handled as objects.I am leaning torwards the removal. WDYT?