developit / developit/dlv

array item access?

Open
#27 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.3k
Forks
37
PR merge metrics
No merged PRs in 30d

Description

lodash.get allows for something like this:

```js
get(obj, 'foo[0]')
```

which would correspond to:

```js
obj = {
foo: [
'x' // <-
],
}
```

Any chance this could be supported in dlv as well?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading dlv's existing dot-separated property-path handling and compare the requested `foo[0]` form with lodash.get's behavior. Done means `dlv(obj, 'foo[0]')` returns the first array item while existing deep-property access continues to work; add or update the relevant tests if the project has them.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.