optics-ts icon indicating copy to clipboard operation
optics-ts copied to clipboard

Support JSON-Pointer RFC

Open thadk opened this issue 2 years ago • 0 comments

Maybe I'm misunderstanding as I'm still learning the library with Jotai, but it seems like it might be possible to use the JSON Pointer RFC standard to focus the optics on a path, in addition to the existing optics-ts syntax. What do you think?

I find JSON-Pointer useful with same-type-recursive-referential tree-like data structures which I haven't figured out how to deeply use in optics-ts yet.

Here are a few reference implementations:

  • https://gist.github.com/tmcw/86c958655202885a71c89cfcc5e6b850
  • https://gist.github.com/tmcw/c5186205a22d74f9fc624ed07ef68716 (w typed immutable clone)
  • https://github.com/janl/node-jsonpointer
  • https://github.com/janl/node-jsonpointer/pull/51/files
  • https://github.com/manuelstofer/json-pointer

thadk avatar May 12 '22 06:05 thadk