a-js-tools 2.0.0 → 2.0.2

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.
Files changed (52) hide show
  1. package/README.md +0 -4
  2. package/cjs/array/difference.js +1 -4
  3. package/cjs/array/index.js +9 -30
  4. package/cjs/array/intersection.js +1 -6
  5. package/cjs/array/symmetricDifference.js +1 -7
  6. package/cjs/className.js +0 -4
  7. package/cjs/getRandomNumber.js +3 -9
  8. package/cjs/getRandomString.js +19 -19
  9. package/cjs/index.js +4 -4
  10. package/cjs/isNode.js +0 -4
  11. package/cjs/object/createConstructor.js +2 -5
  12. package/cjs/performance.js +8 -16
  13. package/cjs/regexp/autoEscapedRegExp.js +1 -5
  14. package/cjs/regexp/escapeRegExp.js +6 -8
  15. package/cjs/regexp/parse.js +0 -2
  16. package/cjs/sleep.js +3 -6
  17. package/es/array/difference.js +1 -4
  18. package/es/array/index.js +9 -30
  19. package/es/array/intersection.js +1 -6
  20. package/es/array/symmetricDifference.js +1 -7
  21. package/es/className.js +0 -4
  22. package/es/getRandomNumber.js +3 -9
  23. package/es/getRandomString.js +19 -19
  24. package/es/index.js +2 -2
  25. package/es/isNode.js +0 -4
  26. package/es/object/createConstructor.js +2 -5
  27. package/es/performance.js +5 -13
  28. package/es/regexp/autoEscapedRegExp.js +1 -5
  29. package/es/regexp/escapeRegExp.js +6 -8
  30. package/es/regexp/parse.js +0 -2
  31. package/es/sleep.js +2 -5
  32. package/es/{src → types}/array/difference.d.ts +1 -4
  33. package/es/{src → types}/array/index.d.ts +9 -30
  34. package/es/{src → types}/array/intersection.d.ts +1 -6
  35. package/es/{src → types}/array/symmetricDifference.d.ts +1 -7
  36. package/es/{src → types}/className.d.ts +0 -4
  37. package/es/{src → types}/getRandomNumber.d.ts +2 -4
  38. package/es/{src → types}/getRandomString.d.ts +11 -8
  39. package/es/{src → types}/isNode.d.ts +0 -4
  40. package/es/{src → types}/object/createConstructor.d.ts +2 -8
  41. package/es/{src → types}/performance.d.ts +4 -15
  42. package/es/{src → types}/regexp/autoEscapedRegExp.d.ts +1 -5
  43. package/es/types/regexp/escapeRegExp.d.ts +16 -0
  44. package/es/{src → types}/regexp/parse.d.ts +0 -2
  45. package/es/{src → types}/regexp/types.d.ts +0 -5
  46. package/es/{src → types}/sleep.d.ts +0 -3
  47. package/package.json +16 -24
  48. package/es/src/regexp/escapeRegExp.d.ts +0 -18
  49. /package/es/{src → types}/array/union.d.ts +0 -0
  50. /package/es/{src → types}/index.d.ts +0 -0
  51. /package/es/{src → types}/object/index.d.ts +0 -0
  52. /package/es/{src → types}/regexp/index.d.ts +0 -0
package/es/array/index.js CHANGED
@@ -4,25 +4,19 @@ import { difference } from './difference.js';
4
4
  import { symmetricDifference } from './symmetricDifference.js';
5
5
 
6
6
  /**
7
+ * ## 数组的一些方法
7
8
  *
8
- * 数组的一些方法
9
- *
10
- * - union 两个数组的并集(排除共有项)
11
- * - intersection 两个数组的交集(共有项)
12
- * - difference 两个数组的差集 (A - B)
13
- * - symmetricDifference 对称差集 ( A △ B)
14
- *
9
+ * - `union` 两个数组的并集(排除共有项)
10
+ * - `intersection` 两个数组的交集(共有项)
11
+ * - `difference` 两个数组的差集 (A - B)
12
+ * - `symmetricDifference` 对称差集 ( A △ B)
15
13
  */
16
14
  const enArr = {
17
15
  /**
18
- *
19
- * 数组的并集
20
- *
16
+ * ### 数组的并集
21
17
  * <span style="color:#f36;">请注意,参数有不为数组时直接抛出 TypeError</span>
22
18
  * @param arrays - 多个数组
23
19
  * @returns 联合后的数组
24
- *
25
- *
26
20
  * @example
27
21
  *
28
22
  * ```ts
@@ -53,33 +47,27 @@ const enArr = {
53
47
  * // [1, 2, 3, 4, 6]
54
48
  * log(union([1, 2, 3], [2, 4, 6], [1, 2, 3], [1, 2, 3]));
55
49
  * ```
56
- *
57
50
  */
58
51
  union,
59
52
  /**
60
- *
61
- * 两个数组的交集
53
+ * ### 两个数组的交集
62
54
  *
63
55
  * @param a 数组 1️⃣
64
56
  * @param b 数组 2️⃣
65
57
  * @returns 返回两个数组的交集
66
58
  * @example
67
- *
68
59
  * ```ts
69
60
  * import { intersection } from 'a-js-tools';
70
61
  *
71
62
  * const log = console.log;
72
63
  *
73
- *
74
64
  * log(intersection([1, 2, 3, 4], [2, 3])); // [2, 3]
75
65
  * log(intersection([1, 3, 5, 7], [2, 3, 4])); // [3]
76
- *
77
66
  * ```
78
- *
79
67
  */
80
68
  intersection,
81
69
  /**
82
- * 求给出的两个数组的差值(A - B)
70
+ * ### 求给出的两个数组的差值(A - B)
83
71
  *
84
72
  * @param a - 第一个数组
85
73
  * @param b - 第二个数组
@@ -87,13 +75,11 @@ const enArr = {
87
75
  * @description 当两个参数有一个不是数组时将抛出
88
76
  * @returns 返回第一个参数相对第二个参数的差值
89
77
  * @example
90
- *
91
78
  * ```ts
92
79
  * import { difference} from 'a-js-tools';
93
80
  *
94
81
  * const log = console.log;
95
82
  *
96
- *
97
83
  * log(difference([], [1, 2, 3])); // []
98
84
  *
99
85
  * log([1, 2, 3], []); //[1, 2, 3]
@@ -107,19 +93,15 @@ const enArr = {
107
93
  * log(difference([1, 2, 3], null));
108
94
  * log(difference([1, 2, 3], true));
109
95
  * ```
110
- *
111
96
  */
112
97
  difference,
113
98
  /**
114
- *
115
- * 对称差集 ( A △ B)
99
+ * ### 对称差集 ( A △ B)
116
100
  *
117
101
  * @param a - 数组 a
118
102
  * @param b - 数组 b
119
103
  * @returns - 返回一个全新的数组
120
- *
121
104
  * @example
122
- *
123
105
  * ```ts
124
106
  * import { symmetricDifference } from 'a-js-tools';
125
107
  *
@@ -131,16 +113,13 @@ const enArr = {
131
113
  *
132
114
  * log(symmetricDifference([1, 2, 3], [1, 2, 3])); // []
133
115
  *
134
- *
135
116
  * /// TypeError
136
117
  * log(symmetricDifference(1, []));
137
118
  * log(symmetricDifference(undefined, []));
138
119
  * log(symmetricDifference(null, []));
139
120
  * log(symmetricDifference('a', []));
140
121
  * log(symmetricDifference(true, []));
141
- *
142
122
  * ```
143
- *
144
123
  */
145
124
  symmetricDifference,
146
125
  };
@@ -1,25 +1,20 @@
1
1
  import { isArray, isEmptyArray } from 'a-type-of-js';
2
2
 
3
3
  /**
4
- *
5
- * 两个数组的交集
4
+ * ## 两个数组的交集
6
5
  *
7
6
  * @param a 数组 1️⃣
8
7
  * @param b 数组 2️⃣
9
8
  * @returns 返回两个数组的交集
10
9
  * @example
11
- *
12
10
  * ```ts
13
11
  * import { intersection } from 'a-js-tools';
14
12
  *
15
13
  * const log = console.log;
16
14
  *
17
- *
18
15
  * log(intersection([1, 2, 3, 4], [2, 3])); // [2, 3]
19
16
  * log(intersection([1, 3, 5, 7], [2, 3, 4])); // [3]
20
- *
21
17
  * ```
22
- *
23
18
  */
24
19
  function intersection(a, b) {
25
20
  if (!isArray(a) || !isArray(b)) {
@@ -2,15 +2,12 @@ import { isArray, isEmptyArray } from 'a-type-of-js';
2
2
  import { difference } from './difference.js';
3
3
 
4
4
  /**
5
- *
6
- * 对称差集 ( A △ B)
5
+ * ## 对称差集 ( A △ B)
7
6
  *
8
7
  * @param a - 数组 a
9
8
  * @param b - 数组 b
10
9
  * @returns - 返回一个全新的数组
11
- *
12
10
  * @example
13
- *
14
11
  * ```ts
15
12
  * import { symmetricDifference } from 'a-js-tools';
16
13
  *
@@ -22,16 +19,13 @@ import { difference } from './difference.js';
22
19
  *
23
20
  * log(symmetricDifference([1, 2, 3], [1, 2, 3])); // []
24
21
  *
25
- *
26
22
  * /// TypeError
27
23
  * log(symmetricDifference(1, []));
28
24
  * log(symmetricDifference(undefined, []));
29
25
  * log(symmetricDifference(null, []));
30
26
  * log(symmetricDifference('a', []));
31
27
  * log(symmetricDifference(true, []));
32
- *
33
28
  * ```
34
- *
35
29
  */
36
30
  function symmetricDifference(a, b) {
37
31
  if (!isArray(a) || !isArray(b)) {
package/es/className.js CHANGED
@@ -1,9 +1,5 @@
1
1
  /**
2
2
  * 驼峰命名与连字符命名法的互换
3
- *
4
- * @packageDocumentation
5
- * @module @a-js-tools/class-name
6
- * @license MIT
7
3
  */
8
4
  /**
9
5
  *
@@ -1,15 +1,10 @@
1
1
  import { isNaN, isNumber } from 'a-type-of-js';
2
2
 
3
3
  /**
4
- * 过去随机数
5
- *
6
- * @packageDocumentation
7
- * @module @a-js-tools/get-random-number
8
- * @license MIT
4
+ * 获取随机数
9
5
  */
10
6
  /**
11
- *
12
- * 获取一个随机的整数类型
7
+ * ## 获取一个随机的整数类型
13
8
  *
14
9
  * 您可以传入两个参数并获取它们之间的任意数字,返回值<span style="color:#ff0;">*会包含端值*</span>
15
10
  *
@@ -42,8 +37,7 @@ function getRandomInt(max = 1, min = 0) {
42
37
  return Math.round(Math.random() * (_max - _min) + _min);
43
38
  }
44
39
  /**
45
- *
46
- * 获取任意的浮点数
40
+ * ## 获取任意的浮点数
47
41
  *
48
42
  * 您可以传入两个参数并获取它们之间的任意数字
49
43
  *
@@ -4,19 +4,20 @@ import { getRandomInt } from './getRandomNumber.js';
4
4
 
5
5
  /**
6
6
  * 获取随机字符串
7
- *
8
- * @packageDocumentation
9
- * @module @a-js-tools/get-random-string
10
- * @license MIT
11
7
  */
12
8
  /**
9
+ * 获取简单的随机字符串
13
10
  *
14
- * 获取简单的随机字符串
15
- *
16
- * @param options - 字符串长度
17
- * @returns - 随机字符串
18
- *
11
+ * @param options - 字符串生成参数
12
+ * @returns - 随机字符串
13
+ * @example
14
+ * ```ts
15
+ * import { getRandomString } from 'a-js-tools';
19
16
  *
17
+ * // 获取简单的随机字符串
18
+ * // 'abcdefg'
19
+ * // getRandomString(7);
20
+ * ```
20
21
  */
21
22
  function getRandomString(options) {
22
23
  // 验证输入参数
@@ -88,18 +89,17 @@ function getRandomString(options) {
88
89
  result += str[getRandomInt(strLen - 1)];
89
90
  }
90
91
  /**
92
+ * ## 字符串交叉函数
91
93
  *
92
- * 字符串交叉函数
93
- *
94
- * 非线形串交叉,对相交叉
94
+ * 非线形串交叉,对相交叉
95
95
  *
96
- * @param str1 - 字符串1
97
- * @param str2 - 字符串2
98
- * @returns - 交叉后的字符串
99
- * @example
100
- * ```ts
101
- * interleaveString('abc', '123') // 'a1b2c3'
102
- * ```
96
+ * @param str1 - 字符串1
97
+ * @param str2 - 字符串2
98
+ * @returns - 交叉后的字符串
99
+ * @example
100
+ * ```ts
101
+ * interleaveString('abc', '123') // 'a1b2c3'
102
+ * ```
103
103
  */
104
104
  function interleaveString(str1, str2) {
105
105
  const str1Length = str1.length, str2Length = str2.length;
package/es/index.js CHANGED
@@ -8,7 +8,7 @@ export { autoEscapedRegExp } from './regexp/autoEscapedRegExp.js';
8
8
  export { isBrowser, isNode } from './isNode.js';
9
9
  export { enArr } from './array/index.js';
10
10
  export { sleep } from './sleep.js';
11
- export { intersection } from './array/intersection.js';
12
- export { union } from './array/union.js';
13
11
  export { difference } from './array/difference.js';
12
+ export { intersection } from './array/intersection.js';
14
13
  export { symmetricDifference } from './array/symmetricDifference.js';
14
+ export { union } from './array/union.js';
package/es/isNode.js CHANGED
@@ -1,9 +1,7 @@
1
1
  import { isUndefined } from 'a-type-of-js';
2
2
 
3
3
  /**
4
- *
5
4
  * 判断当前环境是否为 node 环境
6
- *
7
5
  */
8
6
  function isNode() {
9
7
  return !isUndefined((globalThis &&
@@ -13,9 +11,7 @@ function isNode() {
13
11
  undefined);
14
12
  }
15
13
  /**
16
- *
17
14
  * 是否为浏览器环境
18
- *
19
15
  */
20
16
  function isBrowser() {
21
17
  return !isNode();
@@ -1,6 +1,5 @@
1
1
  /**
2
- *
3
- * 构建一个 Constructor 构造函数
2
+ * # 构建一个 Constructor 构造函数
4
3
  *
5
4
  * 接收一个构造函数,然后返回 TS 能识别的构造函数自身
6
5
  *
@@ -10,7 +9,7 @@
10
9
  *
11
10
  * @param constructor - 传入一个构造函数
12
11
  * @returns 返回传入的构造函数
13
- *
12
+ * @example
14
13
  * ```ts
15
14
  * import { createConstructor } from "a-js-tools";
16
15
  *
@@ -31,9 +30,7 @@
31
30
  * const tomConstructor = createConstructor(_tom);
32
31
  *
33
32
  * const b = new tomConstructor(); // 这时就不会显示错误
34
- *
35
33
  * ```
36
- *
37
34
  */
38
35
  function createConstructor(constructor) {
39
36
  constructor.prototype.apply = Function.apply;
package/es/performance.js CHANGED
@@ -1,16 +1,9 @@
1
- import { isUndefined, isNull } from 'a-type-of-js';
2
- import { isFunction } from 'a-type-of-js/isFunction';
3
- import { isNumber } from 'a-type-of-js/isNumber';
1
+ import { isFunction, isNumber, isUndefined, isNull } from 'a-type-of-js';
4
2
 
5
3
  /**
6
4
  * 防抖和节流
7
- *
8
- * @packageDocumentation
9
- * @module @a-js-tools/performance
10
- * @license MIT
11
5
  */
12
6
  /**
13
- *
14
7
  * 防抖
15
8
  *
16
9
  * @param callback 回调函数
@@ -21,11 +14,10 @@ import { isNumber } from 'a-type-of-js/isNumber';
21
14
  * ```ts
22
15
  * const debounce = (callback: Function, delay = 300) => {
23
16
  * let timer: any = null
24
- * return (...args: any[]) => {
25
- * clearTimeout(timer)
26
- * }
27
- * }
28
17
  *
18
+ * return (...args: any[]) => clearTimeout(timer)
19
+ * }
20
+ * ```
29
21
  */
30
22
  function debounce(callback, options = 200) {
31
23
  if (!isFunction(callback))
@@ -66,7 +58,7 @@ function debounce(callback, options = 200) {
66
58
  return result;
67
59
  }
68
60
  /**
69
- * 节流
61
+ * 节流
70
62
  *
71
63
  * @param callback 回调函数
72
64
  * @param options 延迟时间(毫秒),默认 200 (ms) 或设置 this
@@ -3,8 +3,7 @@ import { escapeRegExp } from './escapeRegExp.js';
3
3
  import { parse } from './parse.js';
4
4
 
5
5
  /**
6
- *
7
- * ## 适用于简单的文本字符串自动转化为简单模式正则表达式
6
+ * ## 适用于简单的文本字符串自动转化为简单模式正则表达式
8
7
  *
9
8
  * *若字符串包含且需保留字符类、组、反向引用、量词等时,该方法可能不适用*
10
9
  *
@@ -12,7 +11,6 @@ import { parse } from './parse.js';
12
11
  * @param options 转化选项。 为文本字符串时,默认为正则表达式的标志,还可指定是否匹配开头或结尾
13
12
  * @returns 正则表达式
14
13
  * @example
15
- *
16
14
  * ```ts
17
15
  * import { autoEscapedRegExp } from 'a-regexp';
18
16
  *
@@ -28,9 +26,7 @@ import { parse } from './parse.js';
28
26
  * autoEscapedRegExp('a-zA-Z0-9', 'g'); // => /a-zA-Z0-9/g
29
27
  * autoEscapedRegExp('[a-zA-Z0-9]'); // => /\[a-zA-Z0-9\]/
30
28
  * autoEscapedRegExp('^[a-zA-Z0-9]+$'); // => /\^\[a-zA-Z0-9\]\$/
31
- *
32
29
  * ```
33
- *
34
30
  */
35
31
  function autoEscapedRegExp(pattern, options) {
36
32
  if (!isString(pattern))
@@ -1,18 +1,16 @@
1
1
  /**
2
- *
3
- * 将一个字符串转化为符合正则要求的字符串
2
+ * # 将一个字符串转化为符合正则要求的字符串
4
3
  *
5
4
  * @param str 需要转义的字符串
6
5
  * @requires escapeRegExp 转化后字符串
7
6
  * @example
8
- *
9
7
  * ```ts
10
- * import { escapeRegExp } from 'a-js-tools';
8
+ * import { escapeRegExp } from 'a-js-tools';
11
9
  *
12
- * escapeRegExp('a.b.c'); // 'a\\.b\\.c'
13
- * escapeRegExp('a\\.b\\.c'); // 'a\\\\.b\\\\.c'
14
- * escapeRegExp('[a-z]'); // '\\[a-z\\]'
15
- * escapeRegExp('^abc$'); // '\\^abc\\$'
10
+ * escapeRegExp('a.b.c'); // 'a\\.b\\.c'
11
+ * escapeRegExp('a\\.b\\.c'); // 'a\\\\.b\\\\.c'
12
+ * escapeRegExp('[a-z]'); // '\\[a-z\\]'
13
+ * escapeRegExp('^abc$'); // '\\^abc\\$'
16
14
  * ```
17
15
  */
18
16
  function escapeRegExp(str) {
@@ -1,9 +1,7 @@
1
1
  import { isString, isNull } from 'a-type-of-js';
2
2
 
3
3
  /**
4
- *
5
4
  * 解析 options
6
- *
7
5
  */
8
6
  function parse(options) {
9
7
  // 处理 options
package/es/sleep.js CHANGED
@@ -1,7 +1,6 @@
1
- import { isZero } from 'a-type-of-js/isNumber';
1
+ import { isZero } from 'a-type-of-js';
2
2
 
3
3
  /**
4
- *
5
4
  * ## 线程休息
6
5
  *
7
6
  * 但从调用到执行完毕总是与期望的时间并不相吻合,除非执行是线型的(也不保证时间的严格性)
@@ -21,12 +20,10 @@ import { isZero } from 'a-type-of-js/isNumber';
21
20
  * console.log(Date.now()); // 1748058118471
22
21
  * await sleep(1000);
23
22
  * console.log(Date.now()); // 1748058119473
24
- *
25
23
  * ```
26
- *
27
24
  */
28
25
  async function sleep(delay = 1000) {
29
- if (!isFinite(delay) || delay < 0)
26
+ if (!isFinite(delay) || delay < 4)
30
27
  throw new TypeError('delay 应该是一个正常的数值');
31
28
  if (isZero(delay))
32
29
  return Promise.resolve();
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 求给出的两个数组的差值(A - B)
2
+ * ## 求给出的两个数组的差值(A - B)
3
3
  *
4
4
  * @param a - 第一个数组
5
5
  * @param b - 第二个数组
@@ -7,13 +7,11 @@
7
7
  * @description 当两个参数有一个不是数组时将抛出
8
8
  * @returns 返回第一个参数相对第二个参数的差值
9
9
  * @example
10
- *
11
10
  * ```ts
12
11
  * import { difference} from 'a-js-tools';
13
12
  *
14
13
  * const log = console.log;
15
14
  *
16
- *
17
15
  * log(difference([], [1, 2, 3])); // []
18
16
  *
19
17
  * log([1, 2, 3], []); //[1, 2, 3]
@@ -27,6 +25,5 @@
27
25
  * log(difference([1, 2, 3], null));
28
26
  * log(difference([1, 2, 3], true));
29
27
  * ```
30
- *
31
28
  */
32
29
  export declare function difference<T>(a: T[], b: T[]): T[];
@@ -4,25 +4,19 @@ import { difference } from './difference';
4
4
  import { symmetricDifference } from './symmetricDifference';
5
5
  export { union, intersection, difference, symmetricDifference };
6
6
  /**
7
+ * ## 数组的一些方法
7
8
  *
8
- * 数组的一些方法
9
- *
10
- * - union 两个数组的并集(排除共有项)
11
- * - intersection 两个数组的交集(共有项)
12
- * - difference 两个数组的差集 (A - B)
13
- * - symmetricDifference 对称差集 ( A △ B)
14
- *
9
+ * - `union` 两个数组的并集(排除共有项)
10
+ * - `intersection` 两个数组的交集(共有项)
11
+ * - `difference` 两个数组的差集 (A - B)
12
+ * - `symmetricDifference` 对称差集 ( A △ B)
15
13
  */
16
14
  export declare const enArr: {
17
15
  /**
18
- *
19
- * 数组的并集
20
- *
16
+ * ### 数组的并集
21
17
  * <span style="color:#f36;">请注意,参数有不为数组时直接抛出 TypeError</span>
22
18
  * @param arrays - 多个数组
23
19
  * @returns 联合后的数组
24
- *
25
- *
26
20
  * @example
27
21
  *
28
22
  * ```ts
@@ -53,33 +47,27 @@ export declare const enArr: {
53
47
  * // [1, 2, 3, 4, 6]
54
48
  * log(union([1, 2, 3], [2, 4, 6], [1, 2, 3], [1, 2, 3]));
55
49
  * ```
56
- *
57
50
  */
58
51
  union: typeof union;
59
52
  /**
60
- *
61
- * 两个数组的交集
53
+ * ### 两个数组的交集
62
54
  *
63
55
  * @param a 数组 1️⃣
64
56
  * @param b 数组 2️⃣
65
57
  * @returns 返回两个数组的交集
66
58
  * @example
67
- *
68
59
  * ```ts
69
60
  * import { intersection } from 'a-js-tools';
70
61
  *
71
62
  * const log = console.log;
72
63
  *
73
- *
74
64
  * log(intersection([1, 2, 3, 4], [2, 3])); // [2, 3]
75
65
  * log(intersection([1, 3, 5, 7], [2, 3, 4])); // [3]
76
- *
77
66
  * ```
78
- *
79
67
  */
80
68
  intersection: typeof intersection;
81
69
  /**
82
- * 求给出的两个数组的差值(A - B)
70
+ * ### 求给出的两个数组的差值(A - B)
83
71
  *
84
72
  * @param a - 第一个数组
85
73
  * @param b - 第二个数组
@@ -87,13 +75,11 @@ export declare const enArr: {
87
75
  * @description 当两个参数有一个不是数组时将抛出
88
76
  * @returns 返回第一个参数相对第二个参数的差值
89
77
  * @example
90
- *
91
78
  * ```ts
92
79
  * import { difference} from 'a-js-tools';
93
80
  *
94
81
  * const log = console.log;
95
82
  *
96
- *
97
83
  * log(difference([], [1, 2, 3])); // []
98
84
  *
99
85
  * log([1, 2, 3], []); //[1, 2, 3]
@@ -107,19 +93,15 @@ export declare const enArr: {
107
93
  * log(difference([1, 2, 3], null));
108
94
  * log(difference([1, 2, 3], true));
109
95
  * ```
110
- *
111
96
  */
112
97
  difference: typeof difference;
113
98
  /**
114
- *
115
- * 对称差集 ( A △ B)
99
+ * ### 对称差集 ( A △ B)
116
100
  *
117
101
  * @param a - 数组 a
118
102
  * @param b - 数组 b
119
103
  * @returns - 返回一个全新的数组
120
- *
121
104
  * @example
122
- *
123
105
  * ```ts
124
106
  * import { symmetricDifference } from 'a-js-tools';
125
107
  *
@@ -131,16 +113,13 @@ export declare const enArr: {
131
113
  *
132
114
  * log(symmetricDifference([1, 2, 3], [1, 2, 3])); // []
133
115
  *
134
- *
135
116
  * /// TypeError
136
117
  * log(symmetricDifference(1, []));
137
118
  * log(symmetricDifference(undefined, []));
138
119
  * log(symmetricDifference(null, []));
139
120
  * log(symmetricDifference('a', []));
140
121
  * log(symmetricDifference(true, []));
141
- *
142
122
  * ```
143
- *
144
123
  */
145
124
  symmetricDifference: typeof symmetricDifference;
146
125
  };
@@ -1,22 +1,17 @@
1
1
  /**
2
- *
3
- * 两个数组的交集
2
+ * ## 两个数组的交集
4
3
  *
5
4
  * @param a 数组 1️⃣
6
5
  * @param b 数组 2️⃣
7
6
  * @returns 返回两个数组的交集
8
7
  * @example
9
- *
10
8
  * ```ts
11
9
  * import { intersection } from 'a-js-tools';
12
10
  *
13
11
  * const log = console.log;
14
12
  *
15
- *
16
13
  * log(intersection([1, 2, 3, 4], [2, 3])); // [2, 3]
17
14
  * log(intersection([1, 3, 5, 7], [2, 3, 4])); // [3]
18
- *
19
15
  * ```
20
- *
21
16
  */
22
17
  export declare function intersection<T>(a: T[], b: T[]): T[];
@@ -1,13 +1,10 @@
1
1
  /**
2
- *
3
- * 对称差集 ( A △ B)
2
+ * ## 对称差集 ( A △ B)
4
3
  *
5
4
  * @param a - 数组 a
6
5
  * @param b - 数组 b
7
6
  * @returns - 返回一个全新的数组
8
- *
9
7
  * @example
10
- *
11
8
  * ```ts
12
9
  * import { symmetricDifference } from 'a-js-tools';
13
10
  *
@@ -19,15 +16,12 @@
19
16
  *
20
17
  * log(symmetricDifference([1, 2, 3], [1, 2, 3])); // []
21
18
  *
22
- *
23
19
  * /// TypeError
24
20
  * log(symmetricDifference(1, []));
25
21
  * log(symmetricDifference(undefined, []));
26
22
  * log(symmetricDifference(null, []));
27
23
  * log(symmetricDifference('a', []));
28
24
  * log(symmetricDifference(true, []));
29
- *
30
25
  * ```
31
- *
32
26
  */
33
27
  export declare function symmetricDifference<T>(a: T[], b: T[]): T[];
@@ -1,9 +1,5 @@
1
1
  /**
2
2
  * 驼峰命名与连字符命名法的互换
3
- *
4
- * @packageDocumentation
5
- * @module @a-js-tools/class-name
6
- * @license MIT
7
3
  */
8
4
  /**
9
5
  *