c2-mongoose 2.1.244 → 2.1.245

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.
@@ -36,20 +36,21 @@ var BuildPopulateSingleFlowItem = /** @class */ (function () {
36
36
  }
37
37
  }
38
38
  //FIM
39
- // const existing = populateArray.find((populateAux: IPopulate) => populateAux.path === populateLocal.path)
40
- // if (existing) {
41
- // if (populateLocal.populate && existing.populate){
42
- // if (!existing.populate.path.includes(populateLocal.populate.path)){
43
- // existing.populate.path += populateLocal.populate.path
44
- // }
45
- // }
46
- // const populateAux = {
47
- // ...existing?.populate,
48
- // path: `${existing.populate?.path ?? ``} ${populateLocal.populate?.path ?? ``}`.trim()
49
- // }
50
- // existing.populate = populateAux
51
- // continue
52
- // }
39
+ var existing = populateArray.find(function (populateAux) { return populateAux.path === populateLocal.path; });
40
+ if (existing) {
41
+ return "continue";
42
+ // if (populateLocal.populate && existing.populate){
43
+ // if (!existing.populate.path.includes(populateLocal.populate.path)){
44
+ // existing.populate.path += populateLocal.populate.path
45
+ // }
46
+ // }
47
+ // const populateAux = {
48
+ // ...existing?.populate,
49
+ // path: `${existing.populate?.path ?? ``} ${populateLocal.populate?.path ?? ``}`.trim()
50
+ // }
51
+ // existing.populate = populateAux
52
+ // continue
53
+ }
53
54
  populateArray.push(populateLocal);
54
55
  };
55
56
  var this_1 = this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.244",
3
+ "version": "2.1.245",
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",
@@ -29,9 +29,9 @@ class BuildPopulateSingleFlowItem {
29
29
  }
30
30
  //FIM
31
31
 
32
- // const existing = populateArray.find((populateAux: IPopulate) => populateAux.path === populateLocal.path)
33
- // if (existing) {
34
-
32
+ const existing = populateArray.find((populateAux: IPopulate) => populateAux.path === populateLocal.path)
33
+ if (existing) {
34
+ continue
35
35
  // if (populateLocal.populate && existing.populate){
36
36
  // if (!existing.populate.path.includes(populateLocal.populate.path)){
37
37
  // existing.populate.path += populateLocal.populate.path
@@ -44,7 +44,7 @@ class BuildPopulateSingleFlowItem {
44
44
  // }
45
45
  // existing.populate = populateAux
46
46
  // continue
47
- // }
47
+ }
48
48
 
49
49
  populateArray.push(populateLocal)
50
50
  }