4.17.11
3.10.1
2.4.2
1.3.1

_.toPath(value)

Converts value to a property path array.

Since

4.0.0

Arguments

argument
value
type
*
description
The value to convert.

Returns

(array)

Example

_.toPath("a.b.c");
// => ['a', 'b', 'c']

_.toPath("a[0].b.c");
// => ['a', '0', 'b', 'c']
_.toPath("a.b.c");
// => ['a', 'b', 'c']

_.toPath("a[0].b.c");
// => ['a', '0', 'b', 'c']