jmespath / jmespath/jmespath.jep

Spec extension - string slice

Open
#5 0 comments 16 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
10
Forks
3
PR merge metrics
No merged PRs in 30d

Description

The spec doesn't explicitly exclude strings from being sliced

Index expressions are defined as
```
index-expression = expression bracket-specifier / bracket-specifier
```

and `expression` includes current node and raw-string as follows
```
expression =/ function-expression / pipe-expression / raw-string
expression =/ current-node
```

It should be possible then to do the following and not restrict it to JSON array types only

```javascript
search("FOOBAR", '@[1:3]')
// OUTPUTS: 'OO'
```

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.