Skip to content
This repository was archived by the owner on Aug 9, 2023. It is now read-only.
This repository was archived by the owner on Aug 9, 2023. It is now read-only.

Cannot set property to false #14

Closed
@DxCx

Description

@DxCx

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:

// 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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions