node-mongo-querystring
node-mongo-querystring copied to clipboard
valRegex improperly referenced
https://github.com/Turistforeningen/node-mongo-querystring/blob/9e3554c2b1ea09a0845ae0526647ca5da21d33d4/index.js#L184
- should be
this.valRegexnotthis.valReqex - but then this will replace all valid characters with '', instead of invalid chars
- and is also overwritten for
^and$a few lines below- this should be
ret.value = `^${ret.value}`;instead
- this should be
- an option like
escapeRegex: truemight be more appropriate here- or
escapeRegexChars: /[\\^$.*+?()[\]{}|]/g, where uses.replace(this.escapeRegexChars, '\\$&')to escape (source: lodash _.escapeRegex)
- or