This repository was archived by the owner on Aug 9, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 17
This repository was archived by the owner on Aug 9, 2023. It is now read-only.
Cannot set property to false #14
Copy link
Copy link
Closed
Labels
🐛 type/bugThis is a problemThis is a problem👶 semver/patchThis is a backwards-compatible fixThis is a backwards-compatible fix💪 phase/solvedPost is donePost is done🗄 area/interfaceThis affects the public interfaceThis affects the public interface
Description
Hey,
I have html ast which i am parsing, with some of the properties being "false" (bool false not string).
they are boolean properties and i expect them to be either true or false.
After a processing of hast-to-hyperscript, those props are completely gone.
browsing the code abit, ive found those lines:
Lines 147 to 156 in 5dd6b51
// Ignore nully, `false`, `NaN`, and falsey known booleans. | |
if ( | |
value === null || | |
value === undefined || | |
value === false || | |
value !== value || | |
(info.boolean && !value) | |
) { | |
return | |
} |
(specificlly line 151 (value === false))
which i can understand why would you filter null and undefined, i don't understand why false is being filtered.
looking at the hast github again, i dont see any reasoning for that..
can you please explain this behavior? or maybe that is just a bug?
ManuelHaag and berlysia
Metadata
Metadata
Assignees
Labels
🐛 type/bugThis is a problemThis is a problem👶 semver/patchThis is a backwards-compatible fixThis is a backwards-compatible fix💪 phase/solvedPost is donePost is done🗄 area/interfaceThis affects the public interfaceThis affects the public interface