Skip to content

Deep sorting with comments? #37

@bbugh

Description

@bbugh

Hi 👋🏻 thanks for a library that actually works with jsonc.

Why this feature is better to be included in comment-json? Please describe the scenario

Not exactly a feature request, or maybe it is?

assign can be used for sorting based on the README, but all of my attempts to walk the tree and produce a deep sorted result that preserves comments have ended in failure (and tears).

Provide 1-2 code examples that the usage of the new feature:

Maybe assign can take a function? or a new deepAssign that takes a function?

const sorted = deepAssign({}, parsed, (keys) => keys.sort())

Are you willing to submit a pull request to implement this rule?

If I knew what to do here, I definitely would!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions