@oazmi/kitchensink - v0.9.13
    Preparing search index...

    Function getDotPath

    • get value of nested obj at a given dot-path.

      Type Parameters

      • T extends object = object
      • DP extends string = string

      Parameters

      • obj: T
      • dpath: DP

      Returns DotPathValue<T, DP>

      import { assertEquals } from "jsr:@std/assert"

      const
      data = { kill: { your: { self: [0, 1, { 0: 0, 1: { noice: "YAHAHA", 0: "you found me!" } }] } } },
      dotpath_to_noice_parent = "kill.your.self.2.1"

      assertEquals(getDotPath(data, dotpath_to_noice_parent), { noice: "YAHAHA", 0: "you found me!" })