Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec extension - string slice #5

Open
glenveegee opened this issue May 18, 2020 · 0 comments
Open

Spec extension - string slice #5

glenveegee opened this issue May 18, 2020 · 0 comments

Comments

@glenveegee
Copy link

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

search("FOOBAR", '@[1:3]')
// OUTPUTS: 'OO'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant