c2-mongoose 2.1.199 → 2.1.201
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/dist/flow/SearchFlow.js
CHANGED
|
@@ -96,6 +96,7 @@ var SearchFlow = /** @class */ (function () {
|
|
|
96
96
|
return projectCurrent;
|
|
97
97
|
};
|
|
98
98
|
SearchFlow.prototype.buildPopulate = function () {
|
|
99
|
+
var _a, _b;
|
|
99
100
|
if ((0, Utils_1.isEmpty)(this.populate)) {
|
|
100
101
|
return;
|
|
101
102
|
}
|
|
@@ -104,7 +105,7 @@ var SearchFlow = /** @class */ (function () {
|
|
|
104
105
|
}
|
|
105
106
|
var populates = [];
|
|
106
107
|
var _loop_1 = function () {
|
|
107
|
-
var
|
|
108
|
+
var _d = property.split('.'), first = _d[0], rest = _d.slice(1);
|
|
108
109
|
var nested = rest.join('.');
|
|
109
110
|
var populate = this_1.buildPath(first, nested);
|
|
110
111
|
if (Array.isArray(this_1.select)) {
|
|
@@ -115,19 +116,16 @@ var SearchFlow = /** @class */ (function () {
|
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
var existing = populates.find(function (populateAux) { return populateAux.path === populate.path; });
|
|
118
|
-
if (
|
|
119
|
-
existing.populate =
|
|
120
|
-
|
|
121
|
-
populate: populate.populate,
|
|
122
|
-
select: populate.select
|
|
123
|
-
};
|
|
119
|
+
if (existing !== undefined) {
|
|
120
|
+
var populateAux = __assign(__assign({}, existing === null || existing === void 0 ? void 0 : existing.populate), { path: "".concat((_a = existing.populate) === null || _a === void 0 ? void 0 : _a.path, " ").concat((_b = populate.populate) === null || _b === void 0 ? void 0 : _b.path).trim() });
|
|
121
|
+
existing.populate = populateAux;
|
|
124
122
|
return "continue";
|
|
125
123
|
}
|
|
126
124
|
populates.push(populate);
|
|
127
125
|
};
|
|
128
126
|
var this_1 = this;
|
|
129
|
-
for (var _i = 0,
|
|
130
|
-
var property =
|
|
127
|
+
for (var _i = 0, _c = this.populate; _i < _c.length; _i++) {
|
|
128
|
+
var property = _c[_i];
|
|
131
129
|
_loop_1();
|
|
132
130
|
}
|
|
133
131
|
return populates;
|
package/package.json
CHANGED
package/src/flow/SearchFlow.ts
CHANGED
|
@@ -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 (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
select: populate.select
|
|
103
|
+
if (existing !== undefined) {
|
|
104
|
+
const populateAux = {
|
|
105
|
+
...existing?.populate,
|
|
106
|
+
path: `${(existing as IPopulate).populate?.path} ${populate.populate?.path}`.trim()
|
|
108
107
|
}
|
|
108
|
+
existing.populate = populateAux
|
|
109
109
|
continue
|
|
110
110
|
}
|
|
111
111
|
|