not-node 6.2.16 → 6.2.17
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/package.json +1 -1
- package/src/common.js +15 -16
- package/src/form/env_extractors/query.js +6 -2
package/package.json
CHANGED
package/src/common.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const fs = require("fs");
|
|
2
2
|
const path = require("path");
|
|
3
3
|
const notPath = require("not-path");
|
|
4
|
-
const { rejects } = require("assert");
|
|
5
4
|
|
|
6
5
|
/** @module Common */
|
|
7
6
|
/**
|
|
@@ -157,21 +156,21 @@ module.exports.executeFunctionAsAsync = executeFunctionAsAsync;
|
|
|
157
156
|
**/
|
|
158
157
|
module.exports.executeObjectFunction = async (obj, name, params) => {
|
|
159
158
|
if (obj) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
if (name.indexOf(".") > -1) {
|
|
162
|
+
const proc =
|
|
163
|
+
typeof obj == "object" ? notPath.get(":" + name, obj) : obj[name];
|
|
164
|
+
if (!proc) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
return await executeFunctionAsAsync(proc.bind(obj), params);
|
|
168
|
+
} else {
|
|
169
|
+
if (obj[name] && isFunc(obj[name])) {
|
|
170
|
+
if (isAsync(obj[name])) {
|
|
171
|
+
return await obj[name](...params);
|
|
172
|
+
} else {
|
|
173
|
+
return obj[name](...params);
|
|
175
174
|
}
|
|
176
175
|
}
|
|
177
176
|
}
|
|
@@ -9,11 +9,15 @@ module.exports = (form, req) => {
|
|
|
9
9
|
`${MODULE_NAME}//${MODEL_NAME}`
|
|
10
10
|
);
|
|
11
11
|
if (thisSchema) {
|
|
12
|
-
|
|
12
|
+
let skip, size;
|
|
13
|
+
const pager = notFilter.pager.process(req), //skip,size
|
|
13
14
|
sorter = notFilter.sorter.process(req, thisSchema),
|
|
14
15
|
search = notFilter.search.process(req, thisSchema);
|
|
15
16
|
let filter = notFilter.filter.process(req, thisSchema);
|
|
16
|
-
|
|
17
|
+
if (pager) {
|
|
18
|
+
skip = pager.skip;
|
|
19
|
+
size = pager.size;
|
|
20
|
+
}
|
|
17
21
|
return {
|
|
18
22
|
name: "query",
|
|
19
23
|
value: { skip, size, sorter, search, filter },
|