Skip to content

Cannot perform diff on a Map with non string keys #13

Open

Description

@kbrownlees
> a = i.Map().set(null, 1)
> b = i.Map().set(null, 2)
> id(a, b)
param str (null) is not a string

The error comes from https://github.com/intelie/immutable-js-diff/blob/master/src/path.js#L14 where it is trying to determine the path of the key (https://github.com/intelie/immutable-js-diff/blob/master/src/diff.js#L56).

Activity

  1. tiye commented on Feb 8, 2017

    @tiye

    Somehow it appears to me that we should avoid using null as a key...

  2. pedroteixeira commented on Feb 8, 2017

    @pedroteixeira
    Contributor

    You're probably right. This type of key doesn't seem to be supported, mainly because the implementation was based on the JSON Patch https://tools.ietf.org/html/rfc6902, where all object keys are string.

    Not sure what's the best way to go in representing non-string keys for the patch. Perhaps a escaped symbol to represent?

    Feel free to submit Pull Requests or ideas!

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions