@nocobase/utils 1.2.12-alpha → 1.3.0-alpha.20240710084543
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 +2 -2
- package/lib/assign.d.ts +0 -17
- package/lib/assign.js +0 -143
- package/lib/client.d.ts +0 -29
- package/lib/client.js +0 -86
- package/lib/collections-graph.d.ts +0 -24
- package/lib/collections-graph.js +0 -108
- package/lib/common.d.ts +0 -14
- package/lib/common.js +0 -87
- package/lib/date.d.ts +0 -37
- package/lib/date.js +0 -189
- package/lib/dayjs.d.ts +0 -10
- package/lib/dayjs.js +0 -72
- package/lib/forEach.d.ts +0 -9
- package/lib/forEach.js +0 -45
- package/lib/fs-exists.d.ts +0 -9
- package/lib/fs-exists.js +0 -46
- package/lib/getValuesByPath.d.ts +0 -9
- package/lib/getValuesByPath.js +0 -71
- package/lib/i18n.d.ts +0 -10
- package/lib/i18n.js +0 -43
- package/lib/index.d.ts +0 -35
- package/lib/index.js +0 -98
- package/lib/isPortalInBody.d.ts +0 -13
- package/lib/isPortalInBody.js +0 -54
- package/lib/isValidFilter.d.ts +0 -9
- package/lib/isValidFilter.js +0 -63
- package/lib/json-templates.d.ts +0 -9
- package/lib/json-templates.js +0 -141
- package/lib/koa-multer.d.ts +0 -15
- package/lib/koa-multer.js +0 -94
- package/lib/log.d.ts +0 -9
- package/lib/log.js +0 -39
- package/lib/measure-execution-time.d.ts +0 -9
- package/lib/measure-execution-time.js +0 -44
- package/lib/merge.d.ts +0 -9
- package/lib/merge.js +0 -55
- package/lib/mixin/AsyncEmitter.d.ts +0 -11
- package/lib/mixin/AsyncEmitter.js +0 -80
- package/lib/mixin/index.d.ts +0 -9
- package/lib/mixin/index.js +0 -48
- package/lib/notification.d.ts +0 -9
- package/lib/notification.js +0 -43
- package/lib/number.d.ts +0 -9
- package/lib/number.js +0 -45
- package/lib/parse-date.d.ts +0 -15
- package/lib/parse-date.js +0 -262
- package/lib/parse-filter.d.ts +0 -159
- package/lib/parse-filter.js +0 -317
- package/lib/parseHTML.d.ts +0 -15
- package/lib/parseHTML.js +0 -42
- package/lib/perf-hooks.d.ts +0 -14
- package/lib/perf-hooks.js +0 -69
- package/lib/registry.d.ts +0 -22
- package/lib/registry.js +0 -69
- package/lib/requireModule.d.ts +0 -12
- package/lib/requireModule.js +0 -90
- package/lib/server.d.ts +0 -19
- package/lib/server.js +0 -50
- package/lib/toposort.d.ts +0 -18
- package/lib/toposort.js +0 -83
- package/lib/uid.d.ts +0 -9
- package/lib/uid.js +0 -46
- package/lib/url.d.ts +0 -9
- package/lib/url.js +0 -46
package/lib/server.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __copyProps = (to, from, except, desc) => {
|
|
15
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
-
for (let key of __getOwnPropNames(from))
|
|
17
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
23
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
-
var server_exports = {};
|
|
25
|
-
module.exports = __toCommonJS(server_exports);
|
|
26
|
-
__reExport(server_exports, require("./date"), module.exports);
|
|
27
|
-
__reExport(server_exports, require("./fs-exists"), module.exports);
|
|
28
|
-
__reExport(server_exports, require("./merge"), module.exports);
|
|
29
|
-
__reExport(server_exports, require("./mixin"), module.exports);
|
|
30
|
-
__reExport(server_exports, require("./mixin/AsyncEmitter"), module.exports);
|
|
31
|
-
__reExport(server_exports, require("./number"), module.exports);
|
|
32
|
-
__reExport(server_exports, require("./registry"), module.exports);
|
|
33
|
-
__reExport(server_exports, require("./requireModule"), module.exports);
|
|
34
|
-
__reExport(server_exports, require("./toposort"), module.exports);
|
|
35
|
-
__reExport(server_exports, require("./uid"), module.exports);
|
|
36
|
-
__reExport(server_exports, require("./url"), module.exports);
|
|
37
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
-
0 && (module.exports = {
|
|
39
|
-
...require("./date"),
|
|
40
|
-
...require("./fs-exists"),
|
|
41
|
-
...require("./merge"),
|
|
42
|
-
...require("./mixin"),
|
|
43
|
-
...require("./mixin/AsyncEmitter"),
|
|
44
|
-
...require("./number"),
|
|
45
|
-
...require("./registry"),
|
|
46
|
-
...require("./requireModule"),
|
|
47
|
-
...require("./toposort"),
|
|
48
|
-
...require("./uid"),
|
|
49
|
-
...require("./url")
|
|
50
|
-
});
|
package/lib/toposort.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import Topo from '@hapi/topo';
|
|
10
|
-
export interface ToposortOptions extends Topo.Options {
|
|
11
|
-
tag?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare class Toposort<T> extends Topo.Sorter<T> {
|
|
14
|
-
unshift(...items: any[]): void;
|
|
15
|
-
push(...items: any[]): void;
|
|
16
|
-
add(nodes: T | T[], options?: ToposortOptions): T[];
|
|
17
|
-
}
|
|
18
|
-
export default Toposort;
|
package/lib/toposort.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
17
|
-
var __export = (target, all) => {
|
|
18
|
-
for (var name in all)
|
|
19
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
20
|
-
};
|
|
21
|
-
var __copyProps = (to, from, except, desc) => {
|
|
22
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
|
-
for (let key of __getOwnPropNames(from))
|
|
24
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
25
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
26
|
-
}
|
|
27
|
-
return to;
|
|
28
|
-
};
|
|
29
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
30
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
31
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
32
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
33
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
-
mod
|
|
36
|
-
));
|
|
37
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
-
var toposort_exports = {};
|
|
39
|
-
__export(toposort_exports, {
|
|
40
|
-
Toposort: () => Toposort,
|
|
41
|
-
default: () => toposort_default
|
|
42
|
-
});
|
|
43
|
-
module.exports = __toCommonJS(toposort_exports);
|
|
44
|
-
var import_topo = __toESM(require("@hapi/topo"));
|
|
45
|
-
const _Toposort = class _Toposort extends import_topo.default.Sorter {
|
|
46
|
-
unshift(...items) {
|
|
47
|
-
this._items.unshift(
|
|
48
|
-
...items.map((node) => ({
|
|
49
|
-
node,
|
|
50
|
-
seq: this._items.length,
|
|
51
|
-
sort: 0,
|
|
52
|
-
before: [],
|
|
53
|
-
after: [],
|
|
54
|
-
group: "?"
|
|
55
|
-
}))
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
push(...items) {
|
|
59
|
-
this._items.push(
|
|
60
|
-
...items.map((node) => ({
|
|
61
|
-
node,
|
|
62
|
-
seq: this._items.length,
|
|
63
|
-
sort: 0,
|
|
64
|
-
before: [],
|
|
65
|
-
after: [],
|
|
66
|
-
group: "?"
|
|
67
|
-
}))
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
add(nodes, options) {
|
|
71
|
-
if (options == null ? void 0 : options.tag) {
|
|
72
|
-
options.group = options.tag;
|
|
73
|
-
}
|
|
74
|
-
return super.add(nodes, options);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
__name(_Toposort, "Toposort");
|
|
78
|
-
let Toposort = _Toposort;
|
|
79
|
-
var toposort_default = Toposort;
|
|
80
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
81
|
-
0 && (module.exports = {
|
|
82
|
-
Toposort
|
|
83
|
-
});
|
package/lib/uid.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export declare function uid(len?: number): string;
|
package/lib/uid.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var uid_exports = {};
|
|
29
|
-
__export(uid_exports, {
|
|
30
|
-
uid: () => uid
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(uid_exports);
|
|
33
|
-
let IDX = 36, HEX = "";
|
|
34
|
-
while (IDX--)
|
|
35
|
-
HEX += IDX.toString(36);
|
|
36
|
-
function uid(len) {
|
|
37
|
-
let str = "", num = len || 11;
|
|
38
|
-
while (num--)
|
|
39
|
-
str += HEX[Math.random() * 36 | 0];
|
|
40
|
-
return str;
|
|
41
|
-
}
|
|
42
|
-
__name(uid, "uid");
|
|
43
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
-
0 && (module.exports = {
|
|
45
|
-
uid
|
|
46
|
-
});
|
package/lib/url.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export declare function isURL(string: any): boolean;
|
package/lib/url.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var url_exports = {};
|
|
29
|
-
__export(url_exports, {
|
|
30
|
-
isURL: () => isURL
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(url_exports);
|
|
33
|
-
function isURL(string) {
|
|
34
|
-
let url;
|
|
35
|
-
try {
|
|
36
|
-
url = new URL(string);
|
|
37
|
-
} catch (e) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
return url.protocol === "http:" || url.protocol === "https:";
|
|
41
|
-
}
|
|
42
|
-
__name(isURL, "isURL");
|
|
43
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
-
0 && (module.exports = {
|
|
45
|
-
isURL
|
|
46
|
-
});
|