Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Empty path behavior #6

Open
nfroidure opened this issue Jan 14, 2017 · 2 comments
Open

Empty path behavior #6

nfroidure opened this issue Jan 14, 2017 · 2 comments

Comments

@nfroidure
Copy link
Contributor

Hi guys ;)

I noticed that querying for an empty path leads to an empty array.

miniquery('', ['yop']);
// []

I think it would be better to simply return the given values since an empty path means gimme your roots.

miniquery('', ['yop']);
// ['yop']

Any thoughts on it? If you're open to those changes, I'm going to PR the project to get it working.

@SebastienElet
Copy link
Contributor

It should work also with :

miniquery('*', ['yop']);
// ['yop']

I'm ok for those changes but this will need a major release

@nfroidure
Copy link
Contributor Author

Great, i'll work on it soon.

Just tested the '*' pattern but as expected it returned nothing since it look for values in any properties of objects.

node
> var miniquery = require('miniquery')
undefined
> miniquery('*', ['plop'])
[]
> 

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants