Skip to content

"null" key parses as the empty string #554

@cdaringe

Description

@cdaringe

Describe the bug

null as a key is parsed as the empty string:

> yaml.parse('null: 1')
{ '': 1 }

To Reproduce

> yaml.parse('null: 1')
{ '': 1 }

Expected behaviour

> yaml.parse('null: 1')
{ 'null': 1 }

Versions (please complete the following information):

  • Environment: node 20.x
  • yaml: "2.4.3"

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions