_.toPath(value)

sourcenpm package

Converts value to a property path array.

Since

4.0.0

Arguments

  • value (*): The value to convert.

Returns

(Array): Returns the new property path array.

Example

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