c2-mongoose 2.1.232 → 2.1.233
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.
|
@@ -16,6 +16,9 @@ var BuildSelectSingleFlowItem = /** @class */ (function () {
|
|
|
16
16
|
function BuildSelectSingleFlowItem() {
|
|
17
17
|
}
|
|
18
18
|
BuildSelectSingleFlowItem.prototype.build = function (model, selects) {
|
|
19
|
+
if ((0, Utils_1.isEmpty)(selects)) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
19
22
|
var projection = {};
|
|
20
23
|
for (var _i = 0, selects_1 = selects; _i < selects_1.length; _i++) {
|
|
21
24
|
var field = selects_1[_i];
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import mongoose from "mongoose"
|
|
2
|
-
import { isNotEmpty } from "../../utils/Utils"
|
|
2
|
+
import { isEmpty, isNotEmpty } from "../../utils/Utils"
|
|
3
3
|
|
|
4
4
|
class BuildSelectSingleFlowItem {
|
|
5
5
|
|
|
6
6
|
build(model: mongoose.Model<any>, selects: string[]) {
|
|
7
7
|
|
|
8
|
+
if (isEmpty(selects)) {
|
|
9
|
+
return undefined
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
let projection: any = {}
|
|
9
13
|
for (var field of selects) {
|
|
10
14
|
let include = field.startsWith("-") ? false : true
|