c2-mongoose 1.3.0 → 1.3.1

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.
@@ -229,7 +229,9 @@ var Search = /** @class */ (function () {
229
229
  condition[key] = { $in: value };
230
230
  }
231
231
  }
232
- filters.$and.push(condition);
232
+ if ((0, Utils_1.isNotEmpty)(condition)) {
233
+ filters.$and.push(condition);
234
+ }
233
235
  }
234
236
  });
235
237
  if ((0, Utils_1.isNotEmpty)(objectSearch.model)) {
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Lib to make any search in database mongoose and use as basic crud",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {
8
8
  "build": "tsc",
9
- "preversion": "tsc && git add . && git commit -m 'commiting'",
9
+ "preversion": "tsc",
10
10
  "postversion": "git push && git push --tags && npm publish",
11
- "publish-patch": "npm version patch -m 'Publishing a patch'",
12
- "publish-minor": "npm version minor --force -m 'Publishing a minor'",
13
- "publish-major": "npm version major --force -m 'Publishing a major'"
11
+ "publish-patch": "npm version patch",
12
+ "publish-minor": "npm version minor",
13
+ "publish-major": "npm version major"
14
14
  },
15
15
  "repository": {
16
16
  "type": "git",
@@ -57,7 +57,7 @@ abstract class Search {
57
57
  }
58
58
 
59
59
  private isPageable = () => {
60
- if (isEmpty(this.page)){
60
+ if (isEmpty(this.page)) {
61
61
  this.page = 1
62
62
  }
63
63
 
@@ -183,7 +183,10 @@ abstract class Search {
183
183
  condition[key] = { $in: value }
184
184
  }
185
185
  }
186
- filters.$and.push(condition)
186
+
187
+ if (isNotEmpty(condition)) {
188
+ filters.$and.push(condition)
189
+ }
187
190
  }
188
191
  })
189
192