jamesmcnamara / shades

A lodash-inspired lens-like library for Javascript
MIT License
412 stars 14 forks source link

How to deal with UUID's that start with a number? #15

Closed iwakoscott closed 5 years ago

iwakoscott commented 5 years ago

Issue

I've run into an issue when I have a UUID that begins with a number. For example, if I have data stored at the UUID 8c826e4a0fa442d085959a6ce657fa55, I am getting the following error when trying to use set.

screen shot 2018-10-01 at 11 32 17 am

My Question:

Is using UUID's that begin with a number bad practice to begin with? Or, is there a work around for this that I can't seem to find in the documentation? Thanks in advance!

Codesandbox Demo:

https://codesandbox.io/s/8xyjyl3672

jamesmcnamara commented 5 years ago

Sorry I just saw this!

I'm currently working on a 2.0 version of this library that, among other things, removes the parser in favor of separate strings and numbers.

For example

set('foo.bar[0].baz')

will become

set('foo', 'bar', 0, 'baz')

This will enable allow us to strongly type shades, remove all of the parsing and compiling, and will solve this issue along the way :)

I'll let you know as soon as the beta is out.

iwakoscott commented 5 years ago

Awesome! Can't wait for this new update!

jamesmcnamara commented 5 years ago

Sorry for the huge delay, but a preview of 2.0 is now available! You can install it with

npm i shades@beta
iwakoscott commented 5 years ago

Sounds good to me. Thanks for all of your hard work!