sindresorhus / dot-prop

Get, set, or delete a property from a nested object using a dot path

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

default value isn't returned when accessing nonexistent obj property within array

mreinstein opened this issue · comments

const obj = {
  a: [
    { b: 'cool' }
  ]
}

const r = dotProp.get(obj, 'a.0.nonexistant', 'bleep')

expected: r === 'bleep'

actual: r === undefined

I guess this is a subset of #71 so I'll just close in favor of that.