pg-tsquery
pg-tsquery copied to clipboard
:mag: Parse user input into a valid PostgreSQL tsquery
With the `{ singleQuoteReplacement: "&" }` option the search term `one'` or `'one` …produces the invalid syntax: `one&` …I think the rule is too simplistic here?
Invalid `tsquery` output given for the following case, ```js const tsquery = require('pg-tsquery'); console.log(tsquery()("env\\: *")) // env\ – note that `:` and `*` are missing ```
if the string passed in contains a word that starts with and it gets munged.. example strings: gillian anderson yields gillian&erson robert andros yields robert&ros