43081j / 43081j/picoquery

Decide how to deal object keying into an array

Open
#45 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
107
Forks
2
Avg merge
16h 31m
Merged PRs (30d)
1

Description

Currently, this is true:

```ts
const result = parse('arr[prop]=1', {
nesting: true,
nestingSyntax: 'js'
});

// result
({
arr: []
});

// however, we keyed into the array and made things _weird_
result.arr.prop; // 1!
```

the choice to be made here is one of these two, i think:

1. leave it as is, someone is using the syntax incorrectly (true, they should be using `arr.prop=1` for an obj, and `arr[0]` for an array)
2. bail when we encounter prop keys of arrays (so `arr` would be a regular `[]` with no funky properties)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.