It will convert the provided property to an array of keys that'll represent the path of a value in an object.
property
path
1.0.0
toPath(0);// => [0] Copy
toPath(0);// => [0]
toPath(Symbol());// => [Symbol()] Copy
toPath(Symbol());// => [Symbol()]
toPath("a.b[0].c[d]");// => ["a", "b", "0", "c", "d"] Copy
toPath("a.b[0].c[d]");// => ["a", "b", "0", "c", "d"]
toPath("a.b.0.c.d");// => ["a", "b", "0", "c", "d"] Copy
toPath("a.b.0.c.d");// => ["a", "b", "0", "c", "d"]
It will convert the provided
property
to an array of keys that'll represent thepath
of a value in an object.