@extremejs/utils - v1.0.0-beta.23
    Preparing search index...

    Function toPath

    • It will convert the provided property to an array of keys that'll represent the path of a value in an object.

      Type Parameters

      • Property extends PropertyKey

      Parameters

      Returns PathT<Property>

      1.0.0

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