c2-mongoose 2.1.245 → 2.1.246
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.
|
@@ -62,7 +62,7 @@ var BuildPopulateSingleFlowItem = /** @class */ (function () {
|
|
|
62
62
|
};
|
|
63
63
|
BuildPopulateSingleFlowItem.prototype.buildPath = function (target, nested, populateAcc) {
|
|
64
64
|
// var populate = {} as IPopulate
|
|
65
|
-
var _a;
|
|
65
|
+
var _a, _b;
|
|
66
66
|
if (nested === void 0) { nested = ""; }
|
|
67
67
|
if (populateAcc.path === undefined) {
|
|
68
68
|
populateAcc.path = target;
|
|
@@ -72,9 +72,9 @@ var BuildPopulateSingleFlowItem = /** @class */ (function () {
|
|
|
72
72
|
populateAcc.path = populateAcc.path.trim();
|
|
73
73
|
}
|
|
74
74
|
if ((0, Utils_1.isNotEmpty)(nested)) {
|
|
75
|
-
var
|
|
75
|
+
var _c = nested.split('.'), first = _c[0], rest = _c.slice(1);
|
|
76
76
|
var nested2 = rest.join('.');
|
|
77
|
-
populateAcc.populate = __assign(__assign({}, populateAcc.populate), this.buildPath(first, nested2, populateAcc.populate));
|
|
77
|
+
populateAcc.populate = __assign(__assign({}, populateAcc.populate), this.buildPath(first, nested2, (_b = populateAcc.populate) !== null && _b !== void 0 ? _b : {}));
|
|
78
78
|
}
|
|
79
79
|
return populateAcc;
|
|
80
80
|
};
|
package/package.json
CHANGED
|
@@ -67,7 +67,7 @@ class BuildPopulateSingleFlowItem {
|
|
|
67
67
|
let nested2 = rest.join('.')
|
|
68
68
|
populateAcc.populate = {
|
|
69
69
|
...populateAcc.populate,
|
|
70
|
-
...this.buildPath(first, nested2, populateAcc.populate)
|
|
70
|
+
...this.buildPath(first, nested2, populateAcc.populate ?? {})
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
return populateAcc
|