@lntvow/utils 1.0.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.
package/.editorconfig ADDED
@@ -0,0 +1,14 @@
1
+ # https://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ indent_style = space
7
+ indent_size = 2
8
+ end_of_line = lf
9
+ insert_final_newline = true
10
+ trim_trailing_whitespace = true
11
+
12
+ [*.md]
13
+ insert_final_newline = false
14
+ trim_trailing_whitespace = false
package/.eslintrc.cjs ADDED
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ root: true,
3
+ extends: ['@lntvow'],
4
+ }
package/.prettierrc.js ADDED
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ printWidth: 80,
3
+ semi: false,
4
+ singleQuote: true,
5
+ arrowParens: 'avoid',
6
+ trailingComma: 'es5',
7
+ htmlWhitespaceSensitivity: 'ignore',
8
+ }
package/1.html ADDED
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Document</title>
8
+ </head>
9
+ <body></body>
10
+ <script type="module">
11
+ import a from './src/index.js'
12
+ console.log('a: ', a)
13
+ </script>
14
+ </html>
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # 工具库
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@lntvow/utils",
3
+ "version": "1.0.1",
4
+ "description": "工具库",
5
+ "main": "./src/index.js",
6
+ "author": "lntvow",
7
+ "license": "MIT",
8
+ "devDependencies": {
9
+ "@lntvow/eslint-config": "^2.0.40",
10
+ "bumpp": "^8.2.1",
11
+ "commitizen": "^4.3.0",
12
+ "cz-conventional-changelog": "^3.3.0"
13
+ },
14
+ "config": {
15
+ "commitizen": {
16
+ "path": "node_modules/cz-conventional-changelog"
17
+ }
18
+ },
19
+ "scripts": {
20
+ "rimraf": "rimraf ./node_modules/",
21
+ "commit": "git-cz",
22
+ "preinstall": "npx only-allow pnpm",
23
+ "release": "bumpp package.json --commit --no-tag --push && pnpm -r publish --access public"
24
+ }
25
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @description 获取随机颜色
3
+ * @return {String} 颜色
4
+ * */
5
+
6
+ export default function getRandomColor() {
7
+ return '#' + Math.random().toString(16).slice(2, 8).padEnd(6, 0)
8
+ }
package/src/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import getRandomColor from './getRandomColor.js'
2
+
3
+ export default {
4
+ getRandomColor,
5
+ }