Skip to content

Stringify/parse mismatch when a keyword has multiple values which one of them includes a space #55

@roysharon

Description

@roysharon

When using a keyword with multiple values that one of them includes a space, stringify method works as expected, but parse does not produce the same query:

import parser from 'search-query-parser' 

const options = { keywords: ['brakes'], offsets: false }
const orgQuery = { brakes:['foo bar', 'choo'], exclude: {} }
const stringified = parser.stringify(orgQuery, options)
// stringified = 'brakes:"foo bar",choo'
const destQuery = parser.parse(stringified, options)
// destQuery = { text: ',choo', brakes: 'foo bar', exclude: {} }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions