Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should path be an array? #3

Open
skrat opened this issue Jan 17, 2015 · 3 comments
Open

Should path be an array? #3

skrat opened this issue Jan 17, 2015 · 3 comments

Comments

@skrat
Copy link

skrat commented Jan 17, 2015

I find it pointless to concat and stringify the path, because if one wants to use it (eg. in a getIn call), it has to be parsed. What's the point of having it as string? Yes I do some pattern matching now, using regular expressions, but even that would be faster and more convenient if path would be an array of actual keys.

skrat added a commit to skrat/immutable-js-diff that referenced this issue Jan 17, 2015
@pedroteixeira
Copy link
Contributor

Right now, for us, it's more convenient that .toJSON() is compatible to the json patch spec, which adopts json pointer strings rather than arrays: https://tools.ietf.org/html/rfc6902

Will talk about it, perhaps could be an options to the diff function.

@NodeGuy
Copy link

NodeGuy commented Mar 22, 2017

You may prefer this fork: https://github.com/tgriesser/immutable-diff

@pedroteixeira
Copy link
Contributor

nice! perhaps we could eventually have a single code base, and an API to support both return types

Skywalker13 pushed a commit to Xcraft-Inc/immutable-js-diff that referenced this issue Jan 11, 2023
Use an empty array instead of / for the root.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants