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

    Function get

    • It will return the desired value based on the provided property.

      Type Parameters

      • Value extends RecordT
      • Property extends string
      • Fallback extends any

      Parameters

      Returns ValueAtT<Value, PathT<Property>> | Fallback

      1.0.0

      get({ a: { b: [{ c: { d: 1 } }] } }, "a.b.0.c.d"); // => 1
      
      get({ a: { b: [{ c: { d: 2 } }] } }, "a.b[0][c].d"); // => 2
      
      get({ a: { b: [{ c: { d: 1 } }] } }, "a.b.0.c.e"); // => undefined
      
      get({ a: { b: [{ c: { d: 1 } }] } }, "a.b.0.c.d", 3); // => 3