convert dot-path to an array of key-path in the format compliant with the type KeyPathsOf.
dot-path
key-path
const data = { kill: { your: { self: [0, 1, { 0: 0, 1: { noice: "YAHAHA", 0: "you found me!" } }] } } }const dotpath_to_noice = "kill.your.self.2.1.noice"const keypath_to_noice: DotPathToKeyPath<typeof dotpath_to_noice> & KeyPath<typeof data> = ["kill", "your", "self", "2", "1", "noice"] Copy
const data = { kill: { your: { self: [0, 1, { 0: 0, 1: { noice: "YAHAHA", 0: "you found me!" } }] } } }const dotpath_to_noice = "kill.your.self.2.1.noice"const keypath_to_noice: DotPathToKeyPath<typeof dotpath_to_noice> & KeyPath<typeof data> = ["kill", "your", "self", "2", "1", "noice"]
convert
dot-path
to an array ofkey-path
in the format compliant with the type KeyPathsOf.