@ewb/mongoose-query 1.1.13 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/Query.js CHANGED
@@ -218,8 +218,6 @@ export class Query {
218
218
  for (const key in query) {
219
219
  if (query.hasOwnProperty(key)) {
220
220
  const str = String(query[key]);
221
- if (!str)
222
- continue;
223
221
  if (key[0] === '$') {
224
222
  if (typeof query[key] !== 'string')
225
223
  continue;
@@ -138,7 +138,7 @@ export function greaterLessThanValue(query, operation, field, queryValue) {
138
138
  const SORT_SPLIT = /,|\s/;
139
139
  export function toMongooseOperation(query, operation, field, queryValue) {
140
140
  const value = {
141
- [operation]: queryValue.split(SORT_SPLIT),
141
+ [operation]: queryValue.split(SORT_SPLIT).filter(Boolean),
142
142
  };
143
143
  return { field, value };
144
144
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ewb/mongoose-query",
3
- "version": "1.1.13",
3
+ "version": "1.1.14",
4
4
  "type": "module",
5
5
  "description": "Parse queries and params to mongoose search. Strips dangerous keys and set corrects options with help of query values.",
6
6
  "main": "./lib/index.js",