Square bracket syntax support
I realize that this was already attempted in #24, but with a little extra work I was able to support the edge cases mentioned in the thread.
I tested these changes against the lodash.get tests and it's mostly compatible. The lodash.get tests failing all seem like uncommon edge-cases, so I've opted not to address them.
The following tests from lodash.get fail:
`dlv` should preserve the sign of `0`
`dlv` should get symbol keyed property values
`dlv` should get a key over a path
`dlv` should not ignore empty brackets
`dlv` should handle empty paths
`dlv` should handle complex paths
`dlv` should follow `path` over non-plain objects
`dlv` should return the default value when `path` is empty
This will also address #27
cc @developit @bwendt-mylo
Hey @aarondancer! Thanks for opening the PR. Would you be able to provide some context on why square bracket notation is important for your use-case?
I dare say it make's composing array like indices easier to reason about. Like "im indexing an array, as opposed to accessing a property"... but imo you may very just go dlv(obj, 'a.b.0.c'); dlv(obj2, 'a.b.1.c');, which keep the bundle size down too, and avoids regex.