set the value of nested obj at a given dot-path.
obj
dot-path
import { assertEquals } from "jsr:@std/assert"const data = { kill: { your: { self: [0, 1, { 0: 0, 1: { noice: "YAHAHA", 0: "you found me!" } }] } } }, dotpath_to_yahaha = "kill.your.self.2.1.noice"setDotPath(data, dotpath_to_yahaha, "REEE")assertEquals(getDotPath(data, dotpath_to_yahaha), "REEE") Copy
import { assertEquals } from "jsr:@std/assert"const data = { kill: { your: { self: [0, 1, { 0: 0, 1: { noice: "YAHAHA", 0: "you found me!" } }] } } }, dotpath_to_yahaha = "kill.your.self.2.1.noice"setDotPath(data, dotpath_to_yahaha, "REEE")assertEquals(getDotPath(data, dotpath_to_yahaha), "REEE")
set the value of nested
obj
at a givendot-path
.Example