@vope/utils 1.4.0 → 1.4.1

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.
@@ -1,20 +1,42 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
4
11
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const basic_1 = __importDefault(require("./basic"));
7
- /**
8
- * 分类存储(基于普通的键值存储)
9
- */
10
- class MemoryList extends basic_1.default {
11
- constructor(key) {
12
- super(key, {
13
- mount: (index, reactor) => reactor
14
- ? (reactor.push(index), reactor)
15
- : [index],
16
- reflex: (reactor) => reactor,
17
- });
18
- }
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var list_exports = {};
30
+ __export(list_exports, {
31
+ default: () => MemoryList
32
+ });
33
+ module.exports = __toCommonJS(list_exports);
34
+ var import_basic = __toESM(require("./basic"), 1);
35
+ class MemoryList extends import_basic.default {
36
+ constructor(key) {
37
+ super(key, {
38
+ mount: (index, reactor) => reactor ? (reactor.push(index), reactor) : [index],
39
+ reflex: (reactor) => reactor
40
+ });
41
+ }
19
42
  }
20
- exports.default = MemoryList;
@@ -1,19 +1,43 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
4
11
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const decon_1 = __importDefault(require("../power/decon"));
7
- const basic_1 = __importDefault(require("./basic"));
8
- /**
9
- * 分类存储(基于2的n次幂之和构建唯一键进行存储)
10
- */
11
- class MemoryPower extends basic_1.default {
12
- constructor(key) {
13
- super(key, {
14
- mount: (index, reactor) => (reactor || 0) + 2 ** index,
15
- reflex: (reactor) => (0, decon_1.default)(reactor, 'asc'),
16
- });
17
- }
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var power_exports = {};
30
+ __export(power_exports, {
31
+ default: () => MemoryPower
32
+ });
33
+ module.exports = __toCommonJS(power_exports);
34
+ var import_decon = __toESM(require("../power/decon"), 1);
35
+ var import_basic = __toESM(require("./basic"), 1);
36
+ class MemoryPower extends import_basic.default {
37
+ constructor(key) {
38
+ super(key, {
39
+ mount: (index, reactor) => (reactor || 0) + 2 ** index,
40
+ reflex: (reactor) => (0, import_decon.default)(reactor, "asc")
41
+ });
42
+ }
18
43
  }
19
- exports.default = MemoryPower;
@@ -0,0 +1,16 @@
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 __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var type_d_exports = {};
16
+ module.exports = __toCommonJS(type_d_exports);
package/cjs/once.js CHANGED
@@ -1,15 +1,28 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * 缓存函数返回值
5
- * @param callback 运行返回值的函数
6
- * @param thisArg 绑定到运行函数的this对象
7
- */
8
- exports.default = (func, thisArg) => {
9
- let local;
10
- let inited = false;
11
- return (...list) => inited
12
- ? local
13
- : (inited = true,
14
- local = func.apply(thisArg, list));
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 once_exports = {};
20
+ __export(once_exports, {
21
+ default: () => once_default
22
+ });
23
+ module.exports = __toCommonJS(once_exports);
24
+ var once_default = (func, thisArg) => {
25
+ let local;
26
+ let inited = false;
27
+ return (...list) => inited ? local : (inited = true, local = func.apply(thisArg, list));
15
28
  };
@@ -1,31 +1,43 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 decon_exports = {};
20
+ __export(decon_exports, {
21
+ default: () => decon_default
22
+ });
23
+ module.exports = __toCommonJS(decon_exports);
3
24
  const ERROR_MESSAGE = {
4
- INT: '参数必须是整数',
5
- MIN: '多个2的正整数幂(两两不相等)之和必定大于等于1',
25
+ INT: "\u53C2\u6570\u5FC5\u987B\u662F\u6574\u6570",
26
+ MIN: "\u591A\u4E2A2\u7684\u6B63\u6574\u6570\u5E42(\u4E24\u4E24\u4E0D\u76F8\u7B49)\u4E4B\u548C\u5FC5\u5B9A\u5927\u4E8E\u7B49\u4E8E1"
6
27
  };
7
- /**
8
- * 解构多个2的正整数幂(两两不相等)之和
9
- * @param sum 幂和
10
- * @param sort 排序方式(默认降序)
11
- * @description sum > 2**53则会因为精度问题计算报错
12
- */
13
28
  const deconPowersSum = (sum, sort) => {
14
- if (sum < 1) {
15
- throw new Error(ERROR_MESSAGE.MIN);
16
- }
17
- else if (sum !== Math.floor(sum)) {
18
- throw new Error(ERROR_MESSAGE.INT);
19
- }
20
- const list = [];
21
- let cache = sum;
22
- while (cache) {
23
- const power = Math.log2(cache) ^ 0;
24
- list.push(power);
25
- cache -= Math.pow(2, power);
26
- }
27
- return sort === 'asc'
28
- ? list.reverse()
29
- : list;
29
+ if (sum < 1) {
30
+ throw new Error(ERROR_MESSAGE.MIN);
31
+ } else if (sum !== Math.floor(sum)) {
32
+ throw new Error(ERROR_MESSAGE.INT);
33
+ }
34
+ const list = [];
35
+ let cache = sum;
36
+ while (cache) {
37
+ const power = Math.log2(cache) ^ 0;
38
+ list.push(power);
39
+ cache -= Math.pow(2, power);
40
+ }
41
+ return sort === "asc" ? list.reverse() : list;
30
42
  };
31
- exports.default = deconPowersSum;
43
+ var decon_default = deconPowersSum;
@@ -1,14 +1,36 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
4
11
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const rad_1 = __importDefault(require("./rad"));
7
- /**
8
- * 返回点被旋转指定角度后新的位置
9
- * @param from 旋转点
10
- * @param angle 旋转角度
11
- * @param visit 旋转原点
12
- */
13
- const rotateAngle = (from, angle, visit) => (0, rad_1.default)(from, angle / 180 * Math.PI, visit);
14
- exports.default = rotateAngle;
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var angle_exports = {};
30
+ __export(angle_exports, {
31
+ default: () => angle_default
32
+ });
33
+ module.exports = __toCommonJS(angle_exports);
34
+ var import_rad = __toESM(require("./rad"), 1);
35
+ const rotateAngle = (from, angle, visit) => (0, import_rad.default)(from, angle / 180 * Math.PI, visit);
36
+ var angle_default = rotateAngle;
package/cjs/rotate/rad.js CHANGED
@@ -1,17 +1,32 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * 返回点被旋转指定弧度后新的位置
5
- * @param from 旋转点
6
- * @param rad 旋转弧度
7
- * @param visit 旋转原点
8
- */
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 rad_exports = {};
20
+ __export(rad_exports, {
21
+ default: () => rad_default
22
+ });
23
+ module.exports = __toCommonJS(rad_exports);
9
24
  const rotateRad = (from, rad, visit = [0, 0]) => {
10
- const x = from[0] - visit[0];
11
- const y = from[1] - visit[1];
12
- return [
13
- x * Math.cos(rad) + y * Math.sin(rad) + visit[0],
14
- y * Math.cos(rad) - x * Math.sin(rad) + visit[1],
15
- ];
25
+ const x = from[0] - visit[0];
26
+ const y = from[1] - visit[1];
27
+ return [
28
+ x * Math.cos(rad) + y * Math.sin(rad) + visit[0],
29
+ y * Math.cos(rad) - x * Math.sin(rad) + visit[1]
30
+ ];
16
31
  };
17
- exports.default = rotateRad;
32
+ var rad_default = rotateRad;
package/cjs/union.js CHANGED
@@ -1,29 +1,44 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * 数据联合(用于需要对加入的数据进行智能提示)
5
- */
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
+ default: () => Union
22
+ });
23
+ module.exports = __toCommonJS(union_exports);
6
24
  class Union {
7
- key;
8
- formatter;
9
- #data = {};
10
- #options = {};
11
- get data() {
12
- return this.#data;
13
- }
14
- get options() {
15
- return this.#options;
16
- }
17
- constructor(key, formatter) {
18
- this.key = key;
19
- this.formatter = formatter;
20
- }
21
- add(data) {
22
- const key = data[this.key];
23
- const result = this.formatter(data);
24
- this.#data[key] = result.data;
25
- this.#options[key] = result.option;
26
- return this;
27
- }
25
+ constructor(key, formatter) {
26
+ this.key = key;
27
+ this.formatter = formatter;
28
+ }
29
+ #data = {};
30
+ #options = {};
31
+ get data() {
32
+ return this.#data;
33
+ }
34
+ get options() {
35
+ return this.#options;
36
+ }
37
+ add(data) {
38
+ const key = data[this.key];
39
+ const result = this.formatter(data);
40
+ this.#data[key] = result.data;
41
+ this.#options[key] = result.option;
42
+ return this;
43
+ }
28
44
  }
29
- exports.default = Union;
package/cjs/url/join.js CHANGED
@@ -1,15 +1,31 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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
+ default: () => join_default
22
+ });
23
+ module.exports = __toCommonJS(join_exports);
3
24
  const re = /([^:])\/{2,}/g;
4
- /**
5
- * 实现多个路径拼接
6
- */
7
25
  const joinPaths = (...list) => {
8
- const { length } = list;
9
- if (length === 0)
10
- return '';
11
- return length === 1
12
- ? list[0]
13
- : list.join('/').replace(re, ($0, $1) => `${$1}/`);
26
+ const { length } = list;
27
+ if (length === 0)
28
+ return "";
29
+ return length === 1 ? list[0] : list.join("/").replace(re, ($0, $1) => `${$1}/`);
14
30
  };
15
- exports.default = joinPaths;
31
+ var join_default = joinPaths;
package/cjs/url/params.js CHANGED
@@ -1,37 +1,45 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * url拼接参数
5
- * @param url
6
- * @param params 需要让url携带的参数
7
- * @param isOpenType 是否开启类型处理
8
- * @description 开始类型处理的情况下,undefined会被转成null
9
- */
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
+ default: () => params_default
22
+ });
23
+ module.exports = __toCommonJS(params_exports);
10
24
  const connectURLParams = (url, params, isOpenType) => {
11
- if (!params)
12
- return url;
13
- const list = [];
14
- for (const key in params) {
15
- const value = params[key];
16
- if (value === void 0) {
17
- list.push(key);
18
- }
19
- else if (Array.isArray(value)) {
20
- list.push(key
21
- + '='
22
- + (isOpenType
23
- ? JSON.stringify(value).slice(1, -1)
24
- : value.join(',')));
25
- }
26
- else {
27
- list.push(key + '=' + (isOpenType ? JSON.stringify(value) : value.toString()));
28
- }
25
+ if (!params)
26
+ return url;
27
+ const list = [];
28
+ for (const key in params) {
29
+ const value = params[key];
30
+ if (value === void 0) {
31
+ list.push(key);
32
+ } else if (Array.isArray(value)) {
33
+ list.push(
34
+ key + "=" + (isOpenType ? JSON.stringify(value).slice(1, -1) : value.join(","))
35
+ );
36
+ } else {
37
+ list.push(key + "=" + (isOpenType ? JSON.stringify(value) : value.toString()));
29
38
  }
30
- if (!list.length)
31
- return url;
32
- const caches = list.join('&');
33
- return url.includes('?')
34
- ? url + '&' + caches
35
- : url + '?' + caches;
39
+ }
40
+ if (!list.length)
41
+ return url;
42
+ const caches = list.join("&");
43
+ return url.includes("?") ? url + "&" + caches : url + "?" + caches;
36
44
  };
37
- exports.default = connectURLParams;
45
+ var params_default = connectURLParams;
package/cjs/wait.js CHANGED
@@ -1,6 +1,24 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * 等待
5
- */
6
- exports.default = (delay = 0) => new Promise((resolve) => window.setTimeout(resolve, delay));
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
+ default: () => wait_default
22
+ });
23
+ module.exports = __toCommonJS(wait_exports);
24
+ var wait_default = (delay = 0) => new Promise((resolve) => window.setTimeout(resolve, delay));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vope/utils",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -12,12 +12,12 @@
12
12
  "main": "./cjs/index.js",
13
13
  "scripts": {
14
14
  "build": "npm run cjs | npm run esm | npm run types",
15
- "cjs": "rimraf cjs & npx tsc -p ./tsconfig.cjs.json",
16
- "esm": "rimraf lib & npx esbuild ./src/**/*.ts --outdir=lib",
17
- "types": "rimraf types & npx tsc -p ./tsconfig.types.json & node ./__devs/type.cjs",
15
+ "cjs": "rimraf cjs & esbuild ./src/**/*.ts --format=cjs --outdir=cjs",
16
+ "esm": "rimraf lib & esbuild ./src/**/*.ts --outdir=lib",
17
+ "types": "rimraf types & tsc -p ./tsconfig.types.json & node ./__devs/type.cjs",
18
18
  "trove": "node ./__devs/trove.cjs",
19
19
  "trove:build": "npm run devs & npm run trove",
20
- "devs": "rimraf __devs & npx tsc -p ./tsconfig.devs.json",
20
+ "devs": "rimraf __devs & tsc -p ./tsconfig.devs.json",
21
21
  "test": "node ./__devs/test.cjs & mocha __tests/**/*.js",
22
22
  "test:build": "npm run devs & npm run trove & npm run test",
23
23
  "prepublishOnly": "npm run devs & npm run trove & npm run test & npm run build"