Function default

  • Converts value to a property path array.

    Parameters

    • value: string[]

      The value to convert.

    Returns string[]

    Returns the new property path array.

    5.7.0

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

    toPath('a[0].b.c')
    // => ['a', '0', 'b', 'c']
  • Converts value to a property path array.

    Parameters

    • value: string

      The value to convert.

    Returns string[]

    Returns the new property path array.

    5.7.0

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

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