@lntvow/utils 1.0.9 → 1.0.10
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/index.cjs.js +1 -28
- package/dist/index.d.ts +2 -17
- package/dist/index.es.js +13 -23
- package/package.json +4 -3
package/dist/index.cjs.js
CHANGED
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @description 获取随机颜色
|
|
5
|
-
* @return {String} 随机颜色
|
|
6
|
-
*
|
|
7
|
-
* @example getRandomColor() => '#f36a38'
|
|
8
|
-
* */
|
|
9
|
-
function getRandomColor() {
|
|
10
|
-
return `#${Math.random().toString(16).slice(2, 8).padEnd(6, '0')}`;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @description 获取随机字符串
|
|
14
|
-
* @param {Number} number 长度
|
|
15
|
-
* @return {String} 随机字符串
|
|
16
|
-
*
|
|
17
|
-
* @example getRandomString(20) => 'tlw491y5ha357l59980n'
|
|
18
|
-
* */
|
|
19
|
-
function getRandomString(number) {
|
|
20
|
-
return number > 10
|
|
21
|
-
? getRandomString(10) + getRandomString(number - 10)
|
|
22
|
-
: Math.random()
|
|
23
|
-
.toString(36)
|
|
24
|
-
.slice(2, number + 2);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
exports.getRandomColor = getRandomColor;
|
|
28
|
-
exports.getRandomString = getRandomString;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function t(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}function n(o){return o>10?n(10)+n(o-10):Math.random().toString(36).slice(2,o+2)}console.log("222222");console.log(111111);function e(){}exports.getRandomColor=t;exports.getRandomString=n;exports.someFunction=e;
|
|
29
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @return {String} 随机颜色
|
|
4
|
-
*
|
|
5
|
-
* @example getRandomColor() => '#f36a38'
|
|
6
|
-
* */
|
|
7
|
-
declare function getRandomColor(): string;
|
|
8
|
-
/**
|
|
9
|
-
* @description 获取随机字符串
|
|
10
|
-
* @param {Number} number 长度
|
|
11
|
-
* @return {String} 随机字符串
|
|
12
|
-
*
|
|
13
|
-
* @example getRandomString(20) => 'tlw491y5ha357l59980n'
|
|
14
|
-
* */
|
|
15
|
-
declare function getRandomString(number: number): string;
|
|
16
|
-
|
|
17
|
-
export { getRandomColor, getRandomString };
|
|
1
|
+
export * from './getRandom';
|
|
2
|
+
export declare function someFunction(): void;
|
package/dist/index.es.js
CHANGED
|
@@ -1,26 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @return {String} 随机颜色
|
|
4
|
-
*
|
|
5
|
-
* @example getRandomColor() => '#f36a38'
|
|
6
|
-
* */
|
|
7
|
-
function getRandomColor() {
|
|
8
|
-
return `#${Math.random().toString(16).slice(2, 8).padEnd(6, '0')}`;
|
|
1
|
+
function t() {
|
|
2
|
+
return `#${Math.random().toString(16).slice(2, 8).padEnd(6, "0")}`;
|
|
9
3
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* @param {Number} number 长度
|
|
13
|
-
* @return {String} 随机字符串
|
|
14
|
-
*
|
|
15
|
-
* @example getRandomString(20) => 'tlw491y5ha357l59980n'
|
|
16
|
-
* */
|
|
17
|
-
function getRandomString(number) {
|
|
18
|
-
return number > 10
|
|
19
|
-
? getRandomString(10) + getRandomString(number - 10)
|
|
20
|
-
: Math.random()
|
|
21
|
-
.toString(36)
|
|
22
|
-
.slice(2, number + 2);
|
|
4
|
+
function n(o) {
|
|
5
|
+
return o > 10 ? n(10) + n(o - 10) : Math.random().toString(36).slice(2, o + 2);
|
|
23
6
|
}
|
|
24
|
-
|
|
25
|
-
|
|
7
|
+
console.log("222222");
|
|
8
|
+
console.log(111111);
|
|
9
|
+
function i() {
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
t as getRandomColor,
|
|
13
|
+
n as getRandomString,
|
|
14
|
+
i as someFunction
|
|
15
|
+
};
|
|
26
16
|
//# sourceMappingURL=index.es.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lntvow/utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "工具库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,10 +33,11 @@
|
|
|
33
33
|
},
|
|
34
34
|
"eslintTypescript": "true",
|
|
35
35
|
"scripts": {
|
|
36
|
+
"dev": "vite build",
|
|
37
|
+
"dts": "vite build -c vite.config.dts.js",
|
|
36
38
|
"test": "vitest",
|
|
37
|
-
"dev": "rollup -cw",
|
|
38
39
|
"build": "pnpm build-dts && rollup -c && pnpm release",
|
|
39
|
-
"build-dts": "
|
|
40
|
+
"build-dts": "tsc -p tsconfig.build.json && rollup -c rollup.dts.config.js",
|
|
40
41
|
"commit": "git add . && git-cz && git push",
|
|
41
42
|
"rimraf": "rimraf ./node_modules/",
|
|
42
43
|
"preinstall": "npx only-allow pnpm",
|