nepsilon / search-query-parser

A simple parser for advanced search query syntax
https://www.npmjs.org/package/search-query-parser
MIT License
253 stars 40 forks source link

API #8

Closed satazor closed 6 years ago

satazor commented 8 years ago

As I said in #7, I'm trying to use this in npms.io.

One minor thing that I think it could be improved: Always return an object even if there's nothing to be parsed. At the moment I need to do something like query = typeof query === 'string' ? { text: query } : query;

Thoughts?

nepsilon commented 8 years ago

I won't be able to code this in the short term. But I'll accept a pull request with the implementation and related tests :)

nepsilon commented 7 years ago

@satazor Do you still need this? Or did you find a work around maybe?

satazor commented 7 years ago

I'm doing the mentioned workaround above. I had no time for the PR and then I totally forgot about it.

nepsilon commented 7 years ago

No problem. Should I close this issue?

satazor commented 7 years ago

Hmm I still think the return value of this module should be consistent. Since I'm overloaded with work I don't have time to do a PR. It's your call to close this issue though.

nepsilon commented 7 years ago

Got it. I'll keep it open for now.