Skip to content

condenseFlow results in invalid object keys #370

@felixfbecker

Description

@felixfbecker
jsYaml.safeDump({key: 'value'}, {
    flowLevel: 0,
    indent: 0,
    lineWidth: Infinity,
    noCompatMode: true,
    sortKeys: true,
    noRefs: true,
    condenseFlow: true
})

results in actual YAML:

{key:value}

but parsing that with safeLoad() results in

{ 'key:value': null }

Expected YAML:

{"key":value}
# or
{key: value}

which results in

{ key: 'value' }

it would be best if the quoting of the key would be controlled by a quoteKeys setting.

cc @eseliger

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions