@zcrkey/js-utils 0.0.3 → 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
@@ -51,6 +51,10 @@ export default App;
51
51
  </script>
52
52
  ```
53
53
 
54
+ ## 更新日志
55
+
56
+ 请查看 [CHANGELOG.md](https://cnb.cool/cnbkey/zcrkey/js-utils/-/blob/master/CHANGELOG.md) 获取版本更新详情。
57
+
54
58
  ## LICENSE
55
59
 
56
60
  MIT
@@ -12,14 +12,14 @@ var CrEventCenter = /*#__PURE__*/function () {
12
12
  _createClass(CrEventCenter, null, [{
13
13
  key: "on",
14
14
  value:
15
- /**
16
- * 新增订阅
17
- *
18
- * @param {*} key 名称
19
- * @param {*} listener 执行函数
20
- * @returns 订阅信息
21
- * @example
22
- this.subscription = CrEventCenter.on('名称', (参数) => {});
15
+ /**
16
+ * 新增订阅
17
+ *
18
+ * @param {*} key 名称
19
+ * @param {*} listener 执行函数
20
+ * @returns 订阅信息
21
+ * @example
22
+ this.subscription = CrEventCenter.on('名称', (参数) => {});
23
23
  */
24
24
  function on(key, listener) {
25
25
  var _this = this;
@@ -44,13 +44,13 @@ var CrEventCenter = /*#__PURE__*/function () {
44
44
  return subscription;
45
45
  }
46
46
 
47
- /**
48
- * 移除订阅
49
- *
50
- * @param {*} subscription
51
- * @param {*} type 'all'
52
- * @example
53
- CrEventCenter.off(this.subscription);
47
+ /**
48
+ * 移除订阅
49
+ *
50
+ * @param {*} subscription
51
+ * @param {*} type 'all'
52
+ * @example
53
+ CrEventCenter.off(this.subscription);
54
54
  */
55
55
  }, {
56
56
  key: "off",
@@ -73,13 +73,13 @@ var CrEventCenter = /*#__PURE__*/function () {
73
73
  }
74
74
  }
75
75
 
76
- /**
77
- * 派发事件
78
- *
79
- * @param {*} key 名称
80
- * @param {*} args 其余参数
81
- * @example
82
- CrEventCenter.emit('名称', 参数数据);
76
+ /**
77
+ * 派发事件
78
+ *
79
+ * @param {*} key 名称
80
+ * @param {*} args 其余参数
81
+ * @example
82
+ CrEventCenter.emit('名称', 参数数据);
83
83
  */
84
84
  }, {
85
85
  key: "emit",
@@ -97,12 +97,12 @@ var CrEventCenter = /*#__PURE__*/function () {
97
97
  }
98
98
  }
99
99
 
100
- /**
101
- * 查找事件
102
- *
103
- * @param {*} key 名称
104
- * @example
105
- let subscriber = CrEventCenter.find('名称');
100
+ /**
101
+ * 查找事件
102
+ *
103
+ * @param {*} key 名称
104
+ * @example
105
+ let subscriber = CrEventCenter.find('名称');
106
106
  */
107
107
  }, {
108
108
  key: "find",
@@ -112,12 +112,12 @@ var CrEventCenter = /*#__PURE__*/function () {
112
112
  });
113
113
  }
114
114
 
115
- /**
116
- * 清理所有事件
117
- *
118
- * @memberof CrEventCenter
119
- * @example
120
- CrEventCenter.clear();
115
+ /**
116
+ * 清理所有事件
117
+ *
118
+ * @memberof CrEventCenter
119
+ * @example
120
+ CrEventCenter.clear();
121
121
  */
122
122
  }, {
123
123
  key: "clear",
@@ -127,8 +127,8 @@ var CrEventCenter = /*#__PURE__*/function () {
127
127
  }]);
128
128
  return CrEventCenter;
129
129
  }();
130
- /**
131
- * 储存订阅者
130
+ /**
131
+ * 储存订阅者
132
132
  */
133
133
  _defineProperty(CrEventCenter, "subscribers", []);
134
134
  export { CrEventCenter as default };
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";