@ivujs/i-utils 1.1.4 → 1.1.6
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/cjs/resolvers/index.cjs +14 -0
- package/dist/es/resolvers/index.d.ts +2 -0
- package/dist/es/resolvers/index.mjs +14 -0
- package/dist/lib/index.full.cjs.js +10 -29
- package/dist/lib/index.full.cjs.min.js +1 -1
- package/dist/lib/index.full.cjs.min.js.map +1 -1
- package/dist/lib/index.full.esm.js +10 -29
- package/dist/lib/index.full.esm.min.js +1 -1
- package/dist/lib/index.full.esm.min.js.map +1 -1
- package/dist/lib/index.full.umd.js +10 -29
- package/dist/lib/index.full.umd.min.js +1 -1
- package/dist/lib/index.full.umd.min.js.map +1 -1
- package/dist/resolvers.d.ts +2 -0
- package/dist/resolves.cjs +14 -0
- package/dist/resolves.mjs +14 -0
- package/package.json +6 -4
- package/dist/global.d.ts +0 -6
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function IUtilsResolver(options = {}) {
|
|
4
|
+
const api = ["getUUID", "getGUID", "loadTest"];
|
|
5
|
+
return (name) => {
|
|
6
|
+
if (api.includes(name)) {
|
|
7
|
+
return {
|
|
8
|
+
name,
|
|
9
|
+
from: "@ivujs/i-utils"
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
exports.IUtilsResolver = IUtilsResolver;
|
|
@@ -1,38 +1,19 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @ivujs/i-utils v1.1.
|
|
2
|
+
* @ivujs/i-utils v1.1.6
|
|
3
3
|
* Copyright 2021-2026, <gao911222@163.com>
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
"use strict";
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
|
|
17
|
-
uuid[14] = "4";
|
|
18
|
-
for (i = 0; i < 36; i++) {
|
|
19
|
-
if (!uuid[i]) {
|
|
20
|
-
r = 0 | Math.random() * 16;
|
|
21
|
-
uuid[i] = CHARS[i === 19 ? r & 3 | 8 : r];
|
|
22
|
-
}
|
|
8
|
+
function IUtilsResolver(options = {}) {
|
|
9
|
+
const api = ["getUUID", "getGUID", "loadTest"];
|
|
10
|
+
return (name) => {
|
|
11
|
+
if (api.includes(name)) {
|
|
12
|
+
return {
|
|
13
|
+
name,
|
|
14
|
+
from: "@ivujs/i-utils"
|
|
15
|
+
};
|
|
23
16
|
}
|
|
24
|
-
}
|
|
25
|
-
return uuid.join("");
|
|
26
|
-
}
|
|
27
|
-
function getGUID() {
|
|
28
|
-
let s4 = function() {
|
|
29
|
-
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
30
17
|
};
|
|
31
|
-
return s4() + s4() + "-" + s4() + "-" + s4() + "-" + s4() + "-" + s4() + s4() + s4();
|
|
32
|
-
}
|
|
33
|
-
function loadedTest() {
|
|
34
|
-
console.log("Nice, iUtils loaded successfully!");
|
|
35
18
|
}
|
|
36
|
-
exports.
|
|
37
|
-
exports.getUUID = getUUID;
|
|
38
|
-
exports.loadedTest = loadedTest;
|
|
19
|
+
exports.IUtilsResolver = IUtilsResolver;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports.IUtilsResolver=function(e={}){const t=["getUUID","getGUID","loadTest"];return e=>{if(t.includes(e))return{name:e,from:"@ivujs/i-utils"}}};
|
|
2
2
|
//# sourceMappingURL=index.full.cjs.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.full.cjs.min.js","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"index.full.cjs.min.js","sources":["../../src/resolvers/index.ts"],"sourcesContent":["import type { Resolver, Options } from \"unplugin-auto-import/types\";\r\n\r\nexport function IUtilsResolver(options: Options = {}): Resolver {\r\n const api = [\"getUUID\", \"getGUID\", \"loadTest\"];\r\n return (name: string) => {\r\n if (api.includes(name)) {\r\n return {\r\n name,\r\n from: \"@ivujs/i-utils\",\r\n };\r\n }\r\n };\r\n}\r\n"],"names":["options","api","name","includes","from"],"mappings":"uGAEO,SAAwBA,EAAmB,IAChD,MAAMC,EAAM,CAAC,UAAW,UAAW,YACnC,OAAQC,IACN,GAAID,EAAIE,SAASD,GACf,MAAO,CACLA,OACAE,KAAM,iBAEV,CAEJ"}
|
|
@@ -1,38 +1,19 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @ivujs/i-utils v1.1.
|
|
2
|
+
* @ivujs/i-utils v1.1.6
|
|
3
3
|
* Copyright 2021-2026, <gao911222@163.com>
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
|
|
15
|
-
uuid[14] = "4";
|
|
16
|
-
for (i = 0; i < 36; i++) {
|
|
17
|
-
if (!uuid[i]) {
|
|
18
|
-
r = 0 | Math.random() * 16;
|
|
19
|
-
uuid[i] = CHARS[i === 19 ? r & 3 | 8 : r];
|
|
20
|
-
}
|
|
6
|
+
function IUtilsResolver(options = {}) {
|
|
7
|
+
const api = ["getUUID", "getGUID", "loadTest"];
|
|
8
|
+
return (name) => {
|
|
9
|
+
if (api.includes(name)) {
|
|
10
|
+
return {
|
|
11
|
+
name,
|
|
12
|
+
from: "@ivujs/i-utils"
|
|
13
|
+
};
|
|
21
14
|
}
|
|
22
|
-
}
|
|
23
|
-
return uuid.join("");
|
|
24
|
-
}
|
|
25
|
-
function getGUID() {
|
|
26
|
-
let s4 = function() {
|
|
27
|
-
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
28
15
|
};
|
|
29
|
-
return s4() + s4() + "-" + s4() + "-" + s4() + "-" + s4() + "-" + s4() + s4() + s4();
|
|
30
|
-
}
|
|
31
|
-
function loadedTest() {
|
|
32
|
-
console.log("Nice, iUtils loaded successfully!");
|
|
33
16
|
}
|
|
34
17
|
export {
|
|
35
|
-
|
|
36
|
-
getUUID,
|
|
37
|
-
loadedTest
|
|
18
|
+
IUtilsResolver
|
|
38
19
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function t(t=
|
|
1
|
+
function t(t={}){const e=["getUUID","getGUID","loadTest"];return t=>{if(e.includes(t))return{name:t,from:"@ivujs/i-utils"}}}export{t as IUtilsResolver};
|
|
2
2
|
//# sourceMappingURL=index.full.esm.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.full.esm.min.js","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"index.full.esm.min.js","sources":["../../src/resolvers/index.ts"],"sourcesContent":["import type { Resolver, Options } from \"unplugin-auto-import/types\";\r\n\r\nexport function IUtilsResolver(options: Options = {}): Resolver {\r\n const api = [\"getUUID\", \"getGUID\", \"loadTest\"];\r\n return (name: string) => {\r\n if (api.includes(name)) {\r\n return {\r\n name,\r\n from: \"@ivujs/i-utils\",\r\n };\r\n }\r\n };\r\n}\r\n"],"names":["IUtilsResolver","options","api","name","includes","from"],"mappings":"AAEO,SAASA,EAAeC,EAAmB,IAChD,MAAMC,EAAM,CAAC,UAAW,UAAW,YACnC,OAAQC,IACN,GAAID,EAAIE,SAASD,GACf,MAAO,CACLA,OACAE,KAAM,iBAEV,CAEJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @ivujs/i-utils v1.1.
|
|
2
|
+
* @ivujs/i-utils v1.1.6
|
|
3
3
|
* Copyright 2021-2026, <gao911222@163.com>
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -7,36 +7,17 @@
|
|
|
7
7
|
typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.iUtils = {}));
|
|
8
8
|
})(this, (function(exports2) {
|
|
9
9
|
"use strict";
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
|
|
19
|
-
uuid[14] = "4";
|
|
20
|
-
for (i = 0; i < 36; i++) {
|
|
21
|
-
if (!uuid[i]) {
|
|
22
|
-
r = 0 | Math.random() * 16;
|
|
23
|
-
uuid[i] = CHARS[i === 19 ? r & 3 | 8 : r];
|
|
24
|
-
}
|
|
10
|
+
function IUtilsResolver(options = {}) {
|
|
11
|
+
const api = ["getUUID", "getGUID", "loadTest"];
|
|
12
|
+
return (name) => {
|
|
13
|
+
if (api.includes(name)) {
|
|
14
|
+
return {
|
|
15
|
+
name,
|
|
16
|
+
from: "@ivujs/i-utils"
|
|
17
|
+
};
|
|
25
18
|
}
|
|
26
|
-
}
|
|
27
|
-
return uuid.join("");
|
|
28
|
-
}
|
|
29
|
-
function getGUID() {
|
|
30
|
-
let s4 = function() {
|
|
31
|
-
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
32
19
|
};
|
|
33
|
-
return s4() + s4() + "-" + s4() + "-" + s4() + "-" + s4() + "-" + s4() + s4() + s4();
|
|
34
|
-
}
|
|
35
|
-
function loadedTest() {
|
|
36
|
-
console.log("Nice, iUtils loaded successfully!");
|
|
37
20
|
}
|
|
38
|
-
exports2.
|
|
39
|
-
exports2.getUUID = getUUID;
|
|
40
|
-
exports2.loadedTest = loadedTest;
|
|
21
|
+
exports2.IUtilsResolver = IUtilsResolver;
|
|
41
22
|
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
42
23
|
}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).iUtils={})}(this,(function(e){"use strict";e.
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).iUtils={})}(this,(function(e){"use strict";e.IUtilsResolver=function(e={}){const t=["getUUID","getGUID","loadTest"];return e=>{if(t.includes(e))return{name:e,from:"@ivujs/i-utils"}}},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|
|
2
2
|
//# sourceMappingURL=index.full.umd.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.full.umd.min.js","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"index.full.umd.min.js","sources":["../../src/resolvers/index.ts"],"sourcesContent":["import type { Resolver, Options } from \"unplugin-auto-import/types\";\r\n\r\nexport function IUtilsResolver(options: Options = {}): Resolver {\r\n const api = [\"getUUID\", \"getGUID\", \"loadTest\"];\r\n return (name: string) => {\r\n if (api.includes(name)) {\r\n return {\r\n name,\r\n from: \"@ivujs/i-utils\",\r\n };\r\n }\r\n };\r\n}\r\n"],"names":["options","api","name","includes","from"],"mappings":"+PAEO,SAAwBA,EAAmB,IAChD,MAAMC,EAAM,CAAC,UAAW,UAAW,YACnC,OAAQC,IACN,GAAID,EAAIE,SAASD,GACf,MAAO,CACLA,OACAE,KAAM,iBAEV,CAEJ"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function IUtilsResolver(options = {}) {
|
|
4
|
+
const api = ["getUUID", "getGUID", "loadTest"];
|
|
5
|
+
return (name) => {
|
|
6
|
+
if (api.includes(name)) {
|
|
7
|
+
return {
|
|
8
|
+
name,
|
|
9
|
+
from: "@ivujs/i-utils"
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
exports.IUtilsResolver = IUtilsResolver;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ivujs/i-utils",
|
|
3
3
|
"moduleName": "iUtils",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.6",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "前端模块化 JavaScript 工具库",
|
|
7
7
|
"author": "<gao911222@163.com>",
|
|
@@ -23,8 +23,10 @@
|
|
|
23
23
|
"import": "./dist/es/index.mjs",
|
|
24
24
|
"require": "./dist/cjs/index.cjs"
|
|
25
25
|
},
|
|
26
|
-
"./
|
|
27
|
-
"types": "./dist/
|
|
26
|
+
"./resolvers": {
|
|
27
|
+
"types": "./dist/resolvers.d.ts",
|
|
28
|
+
"import": "./dist/resolvers.mjs",
|
|
29
|
+
"require": "./dist/resolvers.cjs"
|
|
28
30
|
},
|
|
29
31
|
"./es": {
|
|
30
32
|
"types": "./dist/es/index.d.ts",
|
|
@@ -44,7 +46,6 @@
|
|
|
44
46
|
"dev": "vite",
|
|
45
47
|
"build": "tsx ./build/build.ts"
|
|
46
48
|
},
|
|
47
|
-
"dependencies": {},
|
|
48
49
|
"devDependencies": {
|
|
49
50
|
"@eslint/js": "^9.39.2",
|
|
50
51
|
"@rollup/plugin-terser": "^0.4.4",
|
|
@@ -58,6 +59,7 @@
|
|
|
58
59
|
"tsx": "^4.21.0",
|
|
59
60
|
"typescript": "^5.9.3",
|
|
60
61
|
"typescript-eslint": "^8.53.0",
|
|
62
|
+
"unplugin-auto-import": "^21.0.0",
|
|
61
63
|
"vite": "^7.3.1",
|
|
62
64
|
"vite-plugin-dts": "^4.5.4"
|
|
63
65
|
},
|