-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
When using a string including a keyword with an empty value, calling parse and then stringify produces an empty string:
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:'Metadata
Metadata
Assignees
Labels
No labels