@zcrkey/js-utils 0.0.4 → 0.0.5

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/.dumirc.ts ADDED
@@ -0,0 +1,36 @@
1
+ import { defineConfig } from 'dumi';
2
+
3
+ // more config: https://d.umijs.org/config
4
+ export default defineConfig({
5
+ outputPath: 'docs-dist',
6
+ themeConfig: {
7
+ name: '@zcrkey/js-utils',
8
+ nav: {
9
+ 'zh-CN': [
10
+ { title: '指南', link: '/guide' },
11
+ { title: 'API', link: '/api' },
12
+ ],
13
+ },
14
+ footer: 'zcrkey | Copyright © 2023-present</span>',
15
+ title: '@zcrkey/js-utils',
16
+ description: {
17
+ 'zh-CN': '一个 javascript 实用函数库',
18
+ },
19
+ actions: {
20
+ 'zh-CN': [
21
+ {
22
+ type: 'primary',
23
+ text: '开始使用',
24
+ link: '/guide',
25
+ },
26
+ {
27
+ text: 'API总览',
28
+ link: '/api',
29
+ },
30
+ ],
31
+ },
32
+ socialLinks: {
33
+ github: 'https://cnb.cool/cnbkey/zcrkey/js-utils.git',
34
+ },
35
+ },
36
+ });
package/.fatherrc.ts ADDED
@@ -0,0 +1,14 @@
1
+ import { defineConfig } from 'father';
2
+
3
+ export default defineConfig({
4
+ // more father config: https://github.com/umijs/father/blob/master/docs/config.md
5
+ esm: {
6
+ output: 'dist',
7
+ },
8
+ umd: {
9
+ output: {
10
+ path: 'dist',
11
+ filename: 'index.umd.js',
12
+ },
13
+ },
14
+ });
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ npx commitlint --edit "${1}"
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ npx lint-staged
@@ -0,0 +1,2 @@
1
+ /dist
2
+ *.yaml
package/.stylelintrc ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "@umijs/lint/dist/config/stylelint",
3
+ "rules": {
4
+ "color-hex-length": null,
5
+ "alpha-value-notation": null,
6
+ "comment-empty-line-before": null,
7
+ "selector-class-pattern": null,
8
+ "custom-property-pattern": null
9
+ }
10
+ }
package/README.md CHANGED
@@ -1,56 +1,60 @@
1
- # @zcrkey/js-utils
2
-
3
- 一个 javascript 实用函数库
4
-
5
- ## 安装和使用
6
-
7
- ### 通过 import 方式安装
8
-
9
- 在开始之前,你可能需要安装 [yarn](https://github.com/yarnpkg/yarn/) 或者 [pnpm](https://pnpm.io/zh/)。
10
-
11
- 从 yarn 或 npm 或 pnpm 安装并引入
12
-
13
- ```sh
14
- $ yarn add @zcrkey/js-utils
15
- # or
16
- $ npm install @zcrkey/js-utils --save
17
- # or
18
- $ pnpm install @zcrkey/js-utils --save
19
-
20
- ```
21
-
22
- 修改 `src/App.js`,引入 @zcrkey/js-utils 。
23
-
24
- ```jsx
25
- import React from 'react';
26
- import { CrUtil } from '@zcrkey/js-utils';
27
-
28
- const App = () => (
29
-
30
- useEffect(() => {
31
- console.log(CrUtil.trim(' @zcrkey/js-utils '))
32
- });
33
-
34
- <div className="App">
35
- </div>
36
- );
37
-
38
- export default App;
39
- ```
40
-
41
- ### 通过独立版本安装
42
-
43
- - 下载 @zcrkey/js-utils 的独立版本文件(如 index.umd.js)
44
- - 在 HTML 文件的 \<head\> 或 \<body\> 部分添加 \<script\> 标签,并指向下载的 @zcrkey/js-utils 文件
45
- - 在 HTML 文件中使用 @zcrkey/js-utils
46
-
47
- ```
48
- <script src="./index.umd.js"></script>
49
- <script>
50
- console.log(CrUtil.trim(' @zcrkey/js-utils '))
51
- </script>
52
- ```
53
-
54
- ## LICENSE
55
-
56
- MIT
1
+ # @zcrkey/js-utils
2
+
3
+ 一个 javascript 实用函数库
4
+
5
+ ## 安装和使用
6
+
7
+ ### 通过 import 方式安装
8
+
9
+ 在开始之前,你可能需要安装 [yarn](https://github.com/yarnpkg/yarn/) 或者 [pnpm](https://pnpm.io/zh/)。
10
+
11
+ 从 yarn 或 npm 或 pnpm 安装并引入
12
+
13
+ ```sh
14
+ $ yarn add @zcrkey/js-utils
15
+ # or
16
+ $ npm install @zcrkey/js-utils --save
17
+ # or
18
+ $ pnpm install @zcrkey/js-utils --save
19
+
20
+ ```
21
+
22
+ 修改 `src/App.js`,引入 @zcrkey/js-utils 。
23
+
24
+ ```jsx
25
+ import React from 'react';
26
+ import { CrUtil } from '@zcrkey/js-utils';
27
+
28
+ const App = () => (
29
+
30
+ useEffect(() => {
31
+ console.log(CrUtil.trim(' @zcrkey/js-utils '))
32
+ });
33
+
34
+ <div className="App">
35
+ </div>
36
+ );
37
+
38
+ export default App;
39
+ ```
40
+
41
+ ### 通过独立版本安装
42
+
43
+ - 下载 @zcrkey/js-utils 的独立版本文件(如 index.umd.js)
44
+ - 在 HTML 文件的 \<head\> 或 \<body\> 部分添加 \<script\> 标签,并指向下载的 @zcrkey/js-utils 文件
45
+ - 在 HTML 文件中使用 @zcrkey/js-utils
46
+
47
+ ```
48
+ <script src="./index.umd.js"></script>
49
+ <script>
50
+ console.log(CrUtil.trim(' @zcrkey/js-utils '))
51
+ </script>
52
+ ```
53
+
54
+ ## 更新日志
55
+
56
+ 请查看 [CHANGELOG.md](https://cnb.cool/cnbkey/zcrkey/js-utils/-/blob/master/CHANGELOG.md) 获取版本更新详情。
57
+
58
+ ## LICENSE
59
+
60
+ MIT
package/dist/index.d.ts CHANGED
@@ -1,4 +1,8 @@
1
+ export type * from './eventCenter';
1
2
  export { default as CrEventCenter } from './eventCenter';
2
- export type { TSubscribers, TSubscription } from './eventCenter';
3
+ export type * from './objUtil';
4
+ export { default as CrObjUtil } from './objUtil';
3
5
  export { default as CrStorage } from './storage';
6
+ export type * from './treeUtil';
7
+ export { default as CrTreeUtil } from './treeUtil';
4
8
  export { default as CrUtil } from './util';
package/dist/index.js CHANGED
@@ -1,3 +1,5 @@
1
1
  export { default as CrEventCenter } from "./eventCenter";
2
+ export { default as CrObjUtil } from "./objUtil";
2
3
  export { default as CrStorage } from "./storage";
4
+ export { default as CrTreeUtil } from "./treeUtil";
3
5
  export { default as CrUtil } from "./util";