@nocobase/utils 1.2.34-alpha → 1.2.35-alpha
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/lib/assign.js +1 -1
- package/lib/collections-graph.js +1 -2
- package/lib/json-templates.js +1 -1
- package/lib/koa-multer.js +2 -4
- package/lib/parse-filter.js +6 -6
- package/lib/uid.js +2 -4
- package/package.json +2 -2
package/lib/assign.js
CHANGED
|
@@ -89,7 +89,7 @@ mergeStrategies.set("orMerge", (x, y) => {
|
|
|
89
89
|
});
|
|
90
90
|
mergeStrategies.set("deepMerge", (x, y) => {
|
|
91
91
|
return (0, import_common.isPlainObject)(x) && (0, import_common.isPlainObject)(y) ? (0, import_deepmerge.default)(x, y, {
|
|
92
|
-
arrayMerge: (x2, y2) => y2
|
|
92
|
+
arrayMerge: /* @__PURE__ */ __name((x2, y2) => y2, "arrayMerge")
|
|
93
93
|
}) : y;
|
|
94
94
|
});
|
|
95
95
|
mergeStrategies.set("merge", (x, y) => {
|
package/lib/collections-graph.js
CHANGED
|
@@ -54,8 +54,7 @@ const _CollectionsGraph = class _CollectionsGraph {
|
|
|
54
54
|
for (const node of nodes) {
|
|
55
55
|
const connected = graphlib.alg.preorder(graph, node);
|
|
56
56
|
for (const connectedNode of connected) {
|
|
57
|
-
if (excludes.includes(connectedNode))
|
|
58
|
-
continue;
|
|
57
|
+
if (excludes.includes(connectedNode)) continue;
|
|
59
58
|
connectedNodes.add(connectedNode);
|
|
60
59
|
}
|
|
61
60
|
}
|
package/lib/json-templates.js
CHANGED
package/lib/koa-multer.js
CHANGED
|
@@ -52,16 +52,14 @@ function multer(options) {
|
|
|
52
52
|
}
|
|
53
53
|
__name(multer, "multer");
|
|
54
54
|
function makePromise(multer2, name) {
|
|
55
|
-
if (!multer2[name])
|
|
56
|
-
return;
|
|
55
|
+
if (!multer2[name]) return;
|
|
57
56
|
const fn = multer2[name];
|
|
58
57
|
multer2[name] = function(...args) {
|
|
59
58
|
const middleware = Reflect.apply(fn, this, args);
|
|
60
59
|
return async (ctx, next) => {
|
|
61
60
|
await new Promise((resolve, reject) => {
|
|
62
61
|
middleware(ctx.req, ctx.res, (err) => {
|
|
63
|
-
if (err)
|
|
64
|
-
return reject(err);
|
|
62
|
+
if (err) return reject(err);
|
|
65
63
|
if ("request" in ctx) {
|
|
66
64
|
if (ctx.req.body) {
|
|
67
65
|
ctx.request.body = ctx.req.body;
|
package/lib/parse-filter.js
CHANGED
|
@@ -242,12 +242,12 @@ function utc2unit(options) {
|
|
|
242
242
|
m = m.subtract(-1 * offset, unit);
|
|
243
243
|
}
|
|
244
244
|
const fn = {
|
|
245
|
-
year: () => m.format("YYYY"),
|
|
246
|
-
quarter: () => m.format("YYYY[Q]Q"),
|
|
247
|
-
month: () => m.format("YYYY-MM"),
|
|
248
|
-
week: () => m.format("gggg[w]ww"),
|
|
249
|
-
isoWeek: () => m.format("GGGG[W]WW"),
|
|
250
|
-
day: () => m.format("YYYY-MM-DD")
|
|
245
|
+
year: /* @__PURE__ */ __name(() => m.format("YYYY"), "year"),
|
|
246
|
+
quarter: /* @__PURE__ */ __name(() => m.format("YYYY[Q]Q"), "quarter"),
|
|
247
|
+
month: /* @__PURE__ */ __name(() => m.format("YYYY-MM"), "month"),
|
|
248
|
+
week: /* @__PURE__ */ __name(() => m.format("gggg[w]ww"), "week"),
|
|
249
|
+
isoWeek: /* @__PURE__ */ __name(() => m.format("GGGG[W]WW"), "isoWeek"),
|
|
250
|
+
day: /* @__PURE__ */ __name(() => m.format("YYYY-MM-DD"), "day")
|
|
251
251
|
};
|
|
252
252
|
const r = (_a = fn[unit]) == null ? void 0 : _a.call(fn);
|
|
253
253
|
return timezone ? r + timezone : r;
|
package/lib/uid.js
CHANGED
|
@@ -31,12 +31,10 @@ __export(uid_exports, {
|
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(uid_exports);
|
|
33
33
|
let IDX = 36, HEX = "";
|
|
34
|
-
while (IDX--)
|
|
35
|
-
HEX += IDX.toString(36);
|
|
34
|
+
while (IDX--) HEX += IDX.toString(36);
|
|
36
35
|
function uid(len) {
|
|
37
36
|
let str = "", num = len || 11;
|
|
38
|
-
while (num--)
|
|
39
|
-
str += HEX[Math.random() * 36 | 0];
|
|
37
|
+
while (num--) str += HEX[Math.random() * 36 | 0];
|
|
40
38
|
return str;
|
|
41
39
|
}
|
|
42
40
|
__name(uid, "uid");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/utils",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.35-alpha",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "./lib/index.d.ts",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
"multer": "^1.4.5-lts.1",
|
|
15
15
|
"object-path": "^0.11.8"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "37a4edc27153f9346b3b08c25a407fb57c78b68e"
|
|
18
18
|
}
|