Skip to content

Does addEntry work with toString? #23

@louischoi

Description

@louischoi

When trying the mentioned functions with quotes, I am confused where I thought the mixed quotes would be preserved after parsing the stringified query. Is the following behavior intended? or I simply misused the functions?

var SearchString = require("search-string")
const str1 = "";
const searchString1 = SearchString.parse(str1);
searchString1.addEntry('from', '\'"\'"', false);
console.log(searchString1.getConditionArray()[0].value) // '\"'\"

const str2 = searchString1.toString();
const searchString2 = SearchString.parse(str2);
console.log(searchString2.getConditionArray()[0].value) // \"\"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions