dlv
dlv copied to clipboard
Feature request: ability to escape dot in the key string
const obj = {
"a.b": {
"c": 1
}
}
There are cases when object keys already have a dot in the name. It would be nice to be able to escape the dot so that the split will pass through.
So
dlv(obj, 'a\.b.c') === 1 // true
For anyone encountering this issue: a workaround is to provide the lookup as an array
e.g.
const obj = {
"a.b": {
"c": 1
}
}
dlv(obj, ['a.b', 'c']) === 1 // true
edit: wording
@trijpstra-fourlights I know, I know