Support for arrays in dot notation
Hi,
Is it possible to convert the following back to an object in your example?
{
"id": "my-id",
"nes.ted.value": true,
"other.nested.stuff": 5,
"some.array.0": "A",
"some.array.1": "B"
}
or something like:
{
"id": "my-id",
"nes.ted.value": true,
"other.nested.stuff": 5,
"some.array[0]": "A",
"some.array[1]": "B"
}
to
var obj = {
id: 'my-id',
nes: { ted: { value: true } },
other: { nested: { stuff: 5 } },
some: { array: ['A', 'B'] }
};
Thank you.
Regards, Riaan
It should!
Somehow it is not working however, so I will try to fix it later.
The arrays do not seem to be converted correctly.
I've just added this to a new release 1.1
Both notation variants should now be working.
Awesome!
Thanks
Thanks for adding this, however I'm having an issue, when removing an element from an array, the length doesn't update. Any pointers?
@jasonadkison You have an example of the code you are using?
@rhalff http://codepen.io/jadkison/pen/wKexOg
Thanks a lot, I'll have a look at it.