Skip to content

New JSON method #6

Description

@nmn

There already seems to be a toJSON method on the prototypes of the immutable types.

There should be a new method of JSON as well.

JSON.parseImmutable

This would return an immutable values instead of a mutable one.

In case the toImmutable method is added to the prototypes, this would as simple as this, behind the scenes:

JSON.parseImmutable = (string) => JSON.parse(string).toImmutable()

The actual implementation will be smarter in that it will not throw an error if the JSON value is already immutable (string/number/bool).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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