Open roysharon opened 11 months ago
When using a string including a keyword with an empty value, calling parse and then stringify produces an empty string:
parse
stringify
import parser from 'search-query-parser' const orgStringified = 'brakes:' const options = { keywords: ['brakes'], offsets: false } const query = parser.parse(orgStringified, options) // query = { exclude: {} } const destStringified = parser.stringify(query, options) // destStringified = ''
What I would expect is that the result of parse would include the keyword but with an undefined value, and then stringify can produce the original input:
const expectedQuery = parser.parse(orgStringified, options) // expectedQuery = { brakes: undefined, exclude: {} } const expectedDestStringified = parser.stringify(expectedQuery, options) // expectedDestStringified = 'brakes:'
When using a string including a keyword with an empty value, calling
parse
and thenstringify
produces an empty string:What I would expect is that the result of
parse
would include the keyword but with an undefined value, and thenstringify
can produce the original input: