c2-mongoose 2.1.199 → 2.1.200

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.
@@ -115,12 +115,9 @@ var SearchFlow = /** @class */ (function () {
115
115
  }
116
116
  }
117
117
  var existing = populates.find(function (populateAux) { return populateAux.path === populate.path; });
118
- if ((0, Utils_1.isNotEmpty)(existing)) {
119
- existing.populate = {
120
- path: "".concat(existing.path, " ").concat(populate.path),
121
- populate: populate.populate,
122
- select: populate.select
123
- };
118
+ if (existing !== undefined) {
119
+ var populateAux = __assign(__assign({}, existing === null || existing === void 0 ? void 0 : existing.populate), { path: "".concat(existing.populate.path, " ").concat(populate.populate.path) });
120
+ existing.populate = populateAux;
124
121
  return "continue";
125
122
  }
126
123
  populates.push(populate);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.199",
3
+ "version": "2.1.200",
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",
@@ -100,12 +100,12 @@ abstract class SearchFlow {
100
100
  }
101
101
 
102
102
  const existing = populates.find((populateAux: IPopulate) => populateAux.path === populate.path)
103
- if (isNotEmpty(existing)) {
104
- (existing as IPopulate).populate = {
105
- path: `${(existing as IPopulate).path} ${populate.path}`,
106
- populate: populate.populate,
107
- select: populate.select
103
+ if (existing !== undefined) {
104
+ const populateAux = {
105
+ ...existing?.populate,
106
+ path: `${(existing as IPopulate).populate.path} ${populate.populate.path}`
108
107
  }
108
+ existing.populate = populateAux
109
109
  continue
110
110
  }
111
111