@vope/utils 1.6.0-bate.7 → 1.6.0-bate.8

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/dist/union.js DELETED
@@ -1,67 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var union_exports = {};
20
- __export(union_exports, {
21
- Union: () => Union
22
- });
23
- module.exports = __toCommonJS(union_exports);
24
- class Union {
25
- constructor(key, formatter) {
26
- this.key = key;
27
- this.formatter = formatter;
28
- }
29
- #data = {};
30
- #options = {};
31
- #raws = {};
32
- get data() {
33
- return this.#data;
34
- }
35
- get options() {
36
- return this.#options;
37
- }
38
- add(data) {
39
- const key = data[this.key];
40
- const result = this.formatter(data);
41
- this.#raws[key] = data;
42
- this.#data[key] = result.data;
43
- this.#options[key] = result.option;
44
- return this;
45
- }
46
- /**
47
- * 获取原始数据
48
- */
49
- getRaw(key) {
50
- return this.#raws[key];
51
- }
52
- /**
53
- * 从已有的联合中拷贝数据
54
- */
55
- clone(target, key) {
56
- const { data, options } = target;
57
- const keys = Array.isArray(key) ? key : [key];
58
- keys.forEach((key2) => {
59
- if (key2 in data) {
60
- this.#raws[key2] = target.getRaw(key2);
61
- this.#data[key2] = data[key2];
62
- this.#options[key2] = options[key2];
63
- }
64
- });
65
- return this;
66
- }
67
- }
package/dist/url/join.js DELETED
@@ -1,29 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var join_exports = {};
20
- __export(join_exports, {
21
- joinPaths: () => joinPaths
22
- });
23
- module.exports = __toCommonJS(join_exports);
24
- const re = /([^:])\/{2,}/g;
25
- const joinPaths = (...list) => {
26
- const { length } = list;
27
- if (length === 0) return "";
28
- return length === 1 ? list[0] : list.join("/").replace(re, ($0, $1) => `${$1}/`);
29
- };
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var params_exports = {};
20
- __export(params_exports, {
21
- connectURLParams: () => connectURLParams
22
- });
23
- module.exports = __toCommonJS(params_exports);
24
- var import_url_params = require("../serialize/url-params");
25
- const connectURLParams = (url, params, serializes) => {
26
- const query = (0, import_url_params.flatURLParams)(params, serializes);
27
- return query ? url.includes("?") ? url + "&" + query : url + "?" + query : url;
28
- };
package/dist/wait.js DELETED
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var wait_exports = {};
20
- __export(wait_exports, {
21
- wait: () => wait
22
- });
23
- module.exports = __toCommonJS(wait_exports);
24
- const wait = (delay = 0) => new Promise((resolve) => setTimeout(resolve, delay));