ut2 1.9.2 → 1.9.4

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 (119) hide show
  1. package/dist/ut2.js +11 -16
  2. package/dist/ut2.js.map +1 -1
  3. package/dist/ut2.min.js +1 -1
  4. package/dist/ut2.min.js.map +1 -1
  5. package/es/internals/helpers.js +1 -1
  6. package/es/internals/native.js +1 -2
  7. package/es/isBuffer.js +2 -5
  8. package/es/isObject.js +3 -2
  9. package/es/isTypedArray.js +2 -3
  10. package/es/uniqueId.js +3 -1
  11. package/lib/internals/helpers.js +1 -1
  12. package/lib/internals/native.js +0 -2
  13. package/lib/isBuffer.js +2 -5
  14. package/lib/isObject.js +3 -2
  15. package/lib/isTypedArray.js +2 -3
  16. package/lib/uniqueId.js +3 -1
  17. package/package.json +18 -18
  18. package/types/after.d.ts +1 -1
  19. package/types/ceil.d.ts +2 -2
  20. package/types/chunk.d.ts +1 -1
  21. package/types/clamp.d.ts +3 -3
  22. package/types/conforms.d.ts +1 -1
  23. package/types/conformsTo.d.ts +2 -2
  24. package/types/countBy.d.ts +1 -1
  25. package/types/curry.d.ts +1 -1
  26. package/types/debounce.d.ts +2 -2
  27. package/types/defaultTo.d.ts +2 -2
  28. package/types/delay.d.ts +2 -3
  29. package/types/difference.d.ts +3 -3
  30. package/types/eq.d.ts +2 -2
  31. package/types/escapeRegExp.d.ts +1 -1
  32. package/types/every.d.ts +4 -4
  33. package/types/filter.d.ts +2 -2
  34. package/types/find.d.ts +3 -3
  35. package/types/floor.d.ts +2 -2
  36. package/types/forEach.d.ts +3 -3
  37. package/types/forEachRight.d.ts +3 -3
  38. package/types/groupBy.d.ts +2 -2
  39. package/types/gt.d.ts +2 -2
  40. package/types/gte.d.ts +2 -2
  41. package/types/identity.d.ts +1 -1
  42. package/types/inRange.d.ts +3 -3
  43. package/types/internals/getTag.d.ts +1 -1
  44. package/types/internals/isEqualDeep.d.ts +3 -3
  45. package/types/internals/native.d.ts +2 -3
  46. package/types/intersection.d.ts +3 -3
  47. package/types/invert.d.ts +2 -1
  48. package/types/isArguments.d.ts +1 -1
  49. package/types/isArray.d.ts +1 -1
  50. package/types/isArrayBuffer.d.ts +1 -1
  51. package/types/isArrayLike.d.ts +1 -1
  52. package/types/isArrayLikeObject.d.ts +6 -2
  53. package/types/isBigInt.d.ts +1 -1
  54. package/types/isBlob.d.ts +2 -2
  55. package/types/isBoolean.d.ts +1 -1
  56. package/types/isBuffer.d.ts +3 -4
  57. package/types/isDataView.d.ts +1 -1
  58. package/types/isDate.d.ts +1 -1
  59. package/types/isElement.d.ts +2 -2
  60. package/types/isEmpty.d.ts +1 -1
  61. package/types/isEqual.d.ts +3 -3
  62. package/types/isError.d.ts +3 -3
  63. package/types/isFinite.d.ts +2 -2
  64. package/types/isFunction.d.ts +3 -3
  65. package/types/isInteger.d.ts +2 -2
  66. package/types/isLength.d.ts +1 -1
  67. package/types/isMap.d.ts +1 -1
  68. package/types/isMatch.d.ts +3 -3
  69. package/types/isNaN.d.ts +2 -2
  70. package/types/isNil.d.ts +2 -2
  71. package/types/isNull.d.ts +2 -2
  72. package/types/isNumber.d.ts +1 -1
  73. package/types/isObject.d.ts +3 -2
  74. package/types/isObjectLike.d.ts +2 -2
  75. package/types/isPlainObject.d.ts +2 -2
  76. package/types/isPromiseLike.d.ts +7 -2
  77. package/types/isRegExp.d.ts +1 -1
  78. package/types/isSafeInteger.d.ts +2 -2
  79. package/types/isSet.d.ts +1 -1
  80. package/types/isString.d.ts +1 -1
  81. package/types/isSymbol.d.ts +1 -1
  82. package/types/isTypedArray.d.ts +1 -1
  83. package/types/isUndefined.d.ts +2 -2
  84. package/types/isWeakMap.d.ts +1 -1
  85. package/types/isWeakSet.d.ts +1 -1
  86. package/types/keyBy.d.ts +2 -2
  87. package/types/keys.d.ts +1 -1
  88. package/types/keysIn.d.ts +1 -1
  89. package/types/lt.d.ts +2 -2
  90. package/types/lte.d.ts +2 -2
  91. package/types/map.d.ts +2 -2
  92. package/types/max.d.ts +1 -1
  93. package/types/merge.d.ts +4 -4
  94. package/types/min.d.ts +1 -1
  95. package/types/noop.d.ts +1 -1
  96. package/types/nth.d.ts +1 -1
  97. package/types/nthArg.d.ts +1 -1
  98. package/types/omitBy.d.ts +3 -2
  99. package/types/orderBy.d.ts +1 -1
  100. package/types/partial.d.ts +1 -1
  101. package/types/partition.d.ts +5 -3
  102. package/types/pickBy.d.ts +3 -2
  103. package/types/random.d.ts +2 -2
  104. package/types/randomInt.d.ts +3 -3
  105. package/types/range.d.ts +3 -3
  106. package/types/reduce.d.ts +2 -2
  107. package/types/reduceRight.d.ts +2 -2
  108. package/types/round.d.ts +2 -2
  109. package/types/sleep.d.ts +1 -1
  110. package/types/some.d.ts +4 -4
  111. package/types/throttle.d.ts +2 -2
  112. package/types/times.d.ts +2 -2
  113. package/types/toInteger.d.ts +1 -1
  114. package/types/toString.d.ts +1 -1
  115. package/types/union.d.ts +2 -2
  116. package/types/uniq.d.ts +2 -2
  117. package/types/uniqueId.d.ts +2 -2
  118. package/types/words.d.ts +1 -1
  119. package/types/xor.d.ts +3 -3
package/types/keyBy.d.ts CHANGED
@@ -8,13 +8,13 @@ interface KeyBy {
8
8
  /**
9
9
  * 创建一个组成聚合对象, `key` 是经过 `iteratee` 执行处理 `collection` 中每个元素后返回的结果。每个 `key` 对应的值是生成 `key` 的最后一个元素。
10
10
  *
11
- * `iteratee` 调用时会传入三个参数 `value` `index|key` `collection` 。
11
+ * `iteratee` 调用时会传入三个参数 `value` `index|key` `collection`。
12
12
  *
13
13
  * @function
14
14
  * @alias module:Collection.keyBy
15
15
  * @since 1.0.0
16
16
  * @param {ArrayLike<any> | Object} collection 一个用来迭代的集合。
17
- * @param {Function | string | number | Symbol} [iteratee=identity] 迭代函数,用来转换键。
17
+ * @param {Function | string | number | Symbol} [iteratee=identity] 迭代函数,用来转换键。默认 `identity`。
18
18
  * @returns {Object} 组成聚合对象。
19
19
  * @example
20
20
  *
package/types/keys.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 创建一个数组,包含对象自身的可枚举属性(不包含 `Symbol` 属性)。
3
3
  *
4
- * 同 `Object.keys` 。
4
+ * 同 `Object.keys`。
5
5
  *
6
6
  * @static
7
7
  * @alias module:Object.keys
package/types/keysIn.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 创建一个数组,包含对象自身及继承的可枚举属性(不包含 `Symbol` 属性)。
3
3
  *
4
- * 同 `key...in` 。
4
+ * 同 `key...in`。
5
5
  *
6
6
  * @static
7
7
  * @alias module:Object.keysIn
package/types/lt.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  /**
2
- * 检查 `value` 是否小于 `other` 。
2
+ * 检查 `value` 是否小于 `other`。
3
3
  *
4
4
  * @function
5
5
  * @alias module:Util.lt
6
6
  * @since 1.0.0
7
7
  * @param {*} value 要比较的值。
8
8
  * @param {*} other 另一个要比较的值。
9
- * @returns {boolean} 如果 `value` 小于 `other` 返回 `true` ,否则返回 `false` 。
9
+ * @returns {boolean} 如果 `value` 小于 `other` 返回 `true`,否则返回 `false`。
10
10
  * @example
11
11
  *
12
12
  * lt(1, 3); // true
package/types/lte.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  /**
2
- * 检查 `value` 是否小于或等于 `other` 。
2
+ * 检查 `value` 是否小于或等于 `other`。
3
3
  *
4
4
  * @function
5
5
  * @alias module:Util.lte
6
6
  * @since 1.0.0
7
7
  * @param {*} value 要比较的值。
8
8
  * @param {*} other 另一个要比较的值。
9
- * @returns {boolean} 如果 `value` 小于或等于 `other` 返回 `true` ,否则返回 `false` 。
9
+ * @returns {boolean} 如果 `value` 小于或等于 `other` 返回 `true`,否则返回 `false`。
10
10
  * @example
11
11
  *
12
12
  * lte(1, 3); // true
package/types/map.d.ts CHANGED
@@ -8,13 +8,13 @@ interface Map {
8
8
  /**
9
9
  * 创建一个新数组,这个数组的值由迭代集合每个元素调用 `iteratee` 函数的返回值组成。
10
10
  *
11
- * `iteratee` 调用时会传入三个参数 `value` `index|key` `collection` 。
11
+ * `iteratee` 调用时会传入三个参数 `value` `index|key` `collection`。
12
12
  *
13
13
  * @static
14
14
  * @alias module:Collection.map
15
15
  * @since 1.7.0
16
16
  * @param {ArrayLike<any> | Object} collection 要迭代的集合。
17
- * @param {function} [iteratee=identity] 每次迭代调用的函数。
17
+ * @param {function} [iteratee=identity] 每次迭代调用的函数。默认 `identity`。
18
18
  * @returns {Array} 一个新数组。
19
19
  * @example
20
20
  *
package/types/max.d.ts CHANGED
@@ -2,7 +2,7 @@ import { ExtremumFunction } from './internals/types';
2
2
  /**
3
3
  * 调用 `array` 中的每一个元素,来生成其值排序的标准,返回最大的值。
4
4
  *
5
- * `iteratee` 调用时会传入三个参数 `value` `index` `array` 。
5
+ * `iteratee` 调用时会传入三个参数 `value` `index` `array`。
6
6
  *
7
7
  * @function
8
8
  * @alias module:Math.max
package/types/merge.d.ts CHANGED
@@ -5,15 +5,15 @@ type Customizer = (objValue: any, srcValue: any, key: string | symbol, object: a
5
5
  *
6
6
  * 如果目标值存在,被解析为 `undefined` 的 `source` 来源对象属性将被跳过。数组和普通对象会递归合并,其他对象和值会被直接分配覆盖。
7
7
  *
8
- * 如果你需要合并继承的属性,第四个参数传入 {@link https://caijf.github.io/ut2/module-Object.html#.allKeysIn allKeysIn} 方法, `merge(object, source, undefined, allKeysIn)` 。
8
+ * 如果你需要合并继承的属性,第四个参数传入 {@link https://caijf.github.io/ut2/module-Object.html#.allKeysIn allKeysIn} 方法, `merge(object, source, undefined, allKeysIn)`。
9
9
  *
10
10
  * @static
11
11
  * @alias module:Object.merge
12
12
  * @since 1.0.0
13
13
  * @param {Object | Array} object 目标对象。
14
14
  * @param {Object | Array} source 来源对象。
15
- * @param {Function} [customizer] 自定义赋值函数。
16
- * @param {Function} [getKeys=allKeys] 自定义获取对象键方法。
15
+ * @param {Function} [customizer] 自定义赋值函数,如果函数返回 `undefined` 将使用默认合并。
16
+ * @param {Function} [getKeys=allKeys] 自定义获取对象键方法。默认 `allKeys`。
17
17
  * @returns {Object} 目标对象。
18
18
  * @example
19
19
  *
@@ -28,7 +28,7 @@ type Customizer = (objValue: any, srcValue: any, key: string | symbol, object: a
28
28
  * merge(object, other); // { a: [{b: 2, c: 3}, {d: 4, e: 5}] }
29
29
  *
30
30
  * // 自定义,数组不合并
31
- * merge(object, other, (objValue, srcValue) => Array.isArray(srcValue) ? srcValue : undefined); // { a: [{c: 3},{e: 5}] }
31
+ * merge(object, other, (objValue, srcValue) => isArray(srcValue) ? srcValue : undefined); // { a: [{c: 3},{e: 5}] }
32
32
  */
33
33
  declare function merge<TObject, TSource>(object: TObject, source: TSource, customizer?: Customizer, getKeys?: GetKeysMethod): TObject & TSource;
34
34
  export default merge;
package/types/min.d.ts CHANGED
@@ -2,7 +2,7 @@ import { ExtremumFunction } from './internals/types';
2
2
  /**
3
3
  * 调用 `array` 中的每一个元素,来生成其值排序的标准,返回最小的值。
4
4
  *
5
- * `iteratee` 调用时会传入三个参数 `value` `index` `array` 。
5
+ * `iteratee` 调用时会传入三个参数 `value` `index` `array`。
6
6
  *
7
7
  * @static
8
8
  * @alias module:Math.min
package/types/noop.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 空函数,返回 `undefined` 。
2
+ * 空函数,返回 `undefined`。
3
3
  *
4
4
  * @static
5
5
  * @alias module:Util.noop
package/types/nth.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * @alias module:Array.nth
8
8
  * @since 1.0.0
9
9
  * @param {Array} array 要查询的数组。
10
- * @param {number} [n=0] 要返回元素的索引值。
10
+ * @param {number} [n=0] 要返回元素的索引值。默认 `0`。
11
11
  * @returns {*} 数组的第 `n` 个元素。
12
12
  * @example
13
13
  *
package/types/nthArg.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * @static
5
5
  * @alias module:Util.nthArg
6
6
  * @since 1.0.0
7
- * @param {number} [n=0] 要返回参数的索引值。
7
+ * @param {number} [n=0] 要返回参数的索引值。默认 `0`。
8
8
  * @returns 新函数。
9
9
  * @example
10
10
  *
package/types/omitBy.d.ts CHANGED
@@ -2,13 +2,14 @@ import { ObjectPredicate, WithNullable } from './internals/types';
2
2
  /**
3
3
  * 创建一个对象,该对象忽略 `predicate` (断言函数)判断不是真值的属性后,`object` 自身和继承的可枚举属性组成。与 [`pickBy`](#.pickBy) 相反。
4
4
  *
5
- * `predicate` 调用时会传入两个参数 `value` `key` 。
5
+ * `predicate` 调用时会传入两个参数 `value` `key`。
6
6
  *
7
7
  * @static
8
8
  * @alias module:Object.omitBy
9
9
  * @since 1.0.0
10
+ * @see {@link https://developer.mozilla.org/zh-CN/docs/Glossary/Truthy Truthy}
10
11
  * @param {Object} object 来源对象。
11
- * @param {Function} [predicate] 调用每一个属性的函数,返回 `truthy` 表示要忽略该属性,否则不忽略。
12
+ * @param {Function} [predicate] 调用每一个属性的函数,返回 `Truthy` 表示要忽略该属性,否则不忽略。
12
13
  * @returns {Object} 新对象。
13
14
  * @example
14
15
  *
@@ -11,7 +11,7 @@ interface OrderBy {
11
11
  *
12
12
  * `asc` 升序, `desc` 降序,默认执行稳定排序,也就是说相同元素会保持原始排序。
13
13
  *
14
- * `iteratee` 调用时会传入三个参数 `value` `index|key` `collection` 。
14
+ * `iteratee` 调用时会传入三个参数 `value` `index|key` `collection`。
15
15
  *
16
16
  * @function
17
17
  * @alias module:Collection.orderBy
@@ -37,7 +37,7 @@ interface Partial {
37
37
  _: Placeholder;
38
38
  }
39
39
  /**
40
- * 创建一个函数。该函数调用 `func` ,并传入预设的 `args` 参数。
40
+ * 创建一个函数。该函数调用 `func`,并传入预设的 `args` 参数。
41
41
  *
42
42
  * `partial._` 或 `partial.placeholder` 可用作参数的占位符。
43
43
  *
@@ -6,15 +6,17 @@ interface Partition {
6
6
  <T extends object, V extends T[keyof T]>(collection: CollectionObject<T>, iteratee?: PropertyName): [V[], V[]];
7
7
  }
8
8
  /**
9
- * 创建一个分成两组的元素数组,第一组包含 `predicate`(断言函数)返回为 [`truthy`](https://developer.mozilla.org/zh-CN/docs/Glossary/Truthy)(真值)的元素,第二组包含 `predicate`(断言函数)返回为 [`falsy`](https://developer.mozilla.org/zh-CN/docs/Glossary/Falsy)(假值)的元素。
9
+ * 创建一个分成两组的元素数组,第一组包含 `predicate`(断言函数)返回为 [`Truthy`](https://developer.mozilla.org/zh-CN/docs/Glossary/Truthy)(真值)的元素,第二组包含 `predicate`(断言函数)返回为 [`Falsy`](https://developer.mozilla.org/zh-CN/docs/Glossary/Falsy)(假值)的元素。
10
10
  *
11
- * `predicate` 调用时会传入三个参数 `value` `index|key` `collection` 。
11
+ * `predicate` 调用时会传入三个参数 `value` `index|key` `collection`。
12
12
  *
13
13
  * @static
14
14
  * @alias module:Collection.partition
15
15
  * @since 1.0.0
16
+ * @see {@link https://developer.mozilla.org/zh-CN/docs/Glossary/Truthy Truthy}
17
+ * @see {@link https://developer.mozilla.org/zh-CN/docs/Glossary/Falsy Falsy}
16
18
  * @param {ArrayLike<any> | Object} collection 一个用来迭代的集合。
17
- * @param {Function | string | number | Symbol | Array} [predicate=identity] 每次迭代调用的断言函数。
19
+ * @param {Function | string | number | Symbol | Array} [predicate=identity] 每次迭代调用的断言函数。默认 `identity`。
18
20
  * @returns {Array} 分组后的数组。
19
21
  * @example
20
22
  *
package/types/pickBy.d.ts CHANGED
@@ -2,13 +2,14 @@ import { ObjectPredicate, WithNullable } from './internals/types';
2
2
  /**
3
3
  * 创建一个对象,该对象的属性从 `object` 中经 `predicate` (断言函数)判断为真值的属性。
4
4
  *
5
- * `predicate` 调用时会传入两个参数 `value` `key` 。
5
+ * `predicate` 调用时会传入两个参数 `value` `key`。
6
6
  *
7
7
  * @static
8
8
  * @alias module:Object.pickBy
9
9
  * @since 1.0.0
10
+ * @see {@link https://developer.mozilla.org/zh-CN/docs/Glossary/Truthy Truthy}
10
11
  * @param {Object} obj 来源对象。
11
- * @param {Function} [predicate] 调用每一个属性的函数,返回 `truthy` 表示要提取该属性,否则不提取。
12
+ * @param {Function} [predicate] 调用每一个属性的函数,返回 `Truthy` 表示要提取该属性,否则不提取。
12
13
  * @returns {Object} 新对象。
13
14
  * @example
14
15
  *
package/types/random.d.ts CHANGED
@@ -6,8 +6,8 @@
6
6
  * @static
7
7
  * @alias module:Number.random
8
8
  * @since 1.0.0
9
- * @param {number} [lower=0] 下限,默认 0
10
- * @param {number} [upper=1] 上限,默认 1
9
+ * @param {number} [lower=0] 下限。默认 `0`。
10
+ * @param {number} [upper=1] 上限。默认 `1`。
11
11
  * @returns {number} 随机浮点数。
12
12
  * @example
13
13
  *
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * 产生一个包含 `lower` 与 `upper` 之间的随机整数。
3
3
  *
4
- * 如果参数非整数 `lower=Math.ceil(lower)` `upper=Math.floor(upper)` 。如果 `lower` 大于 `upper` 会自动交换参数。
4
+ * 如果参数非整数 `lower=Math.ceil(lower)` `upper=Math.floor(upper)`。如果 `lower` 大于 `upper` 会自动交换参数。
5
5
  *
6
6
  * @static
7
7
  * @alias module:Number.randomInt
8
8
  * @since 1.0.0
9
- * @param {number} [lower=0] 下限,默认 0
10
- * @param {number} [upper=1] 上限,默认 1
9
+ * @param {number} [lower=0] 下限。默认 `0`。
10
+ * @param {number} [upper=1] 上限。默认 `1`。
11
11
  * @returns {number} 随机整数。
12
12
  * @example
13
13
  *
package/types/range.d.ts CHANGED
@@ -6,14 +6,14 @@ interface Range {
6
6
  /**
7
7
  * 创建一个升序或降序的数字数组。
8
8
  *
9
- * 如果省略 `start` 默认为 0
9
+ * 如果省略 `start` 默认为 `0`。
10
10
  *
11
11
  * @function
12
12
  * @alias module:Util.range
13
13
  * @since 1.6.0
14
- * @param {number} [start=0] 开始值。
14
+ * @param {number} [start=0] 开始值。默认 `0`。
15
15
  * @param {number} end 结束值。
16
- * @param {number} [step] 要增加或减少的值。如果值为 `0` ,将视为无效参数。如果 `start` 在 `end` 之前,默认为 1 ,否则默认为 -1
16
+ * @param {number} [step] 要增加或减少的值。如果值为 `0`,将视为无效参数。如果 `start` 在 `end` 之前。默认为 `1`,否则默认为 `-1`。
17
17
  * @return {number[]} 从开始值(包含)到结束值(不包含)逐步递增或递减的数字数组。
18
18
  * @example
19
19
  *
package/types/reduce.d.ts CHANGED
@@ -3,13 +3,13 @@
3
3
  *
4
4
  * 如果没有提供第三个参数值,则集合中的第一个元素将用作初始值。
5
5
  *
6
- * `iteratee` 调用时会传入四个参数 `accumulator` `value` `index|key` `collection` 。
6
+ * `iteratee` 调用时会传入四个参数 `accumulator` `value` `index|key` `collection`。
7
7
  *
8
8
  * @function
9
9
  * @alias module:Collection.reduce
10
10
  * @since 1.7.0
11
11
  * @param {ArrayLike<any> | Object} collection 要迭代的集合。
12
- * @param {Function} [iteratee=identity] 每次迭代调用的函数。
12
+ * @param {Function} [iteratee=identity] 每次迭代调用的函数。默认 `identity`。
13
13
  * @param {*} [initialValue] 初始值。
14
14
  * @returns {*} 累计值。
15
15
  * @example
@@ -3,13 +3,13 @@
3
3
  *
4
4
  * 如果没有提供第三个参数值,则集合中的第一个元素将用作初始值。
5
5
  *
6
- * `iteratee` 调用时会传入四个参数 `accumulator` `value` `index|key` `collection` 。
6
+ * `iteratee` 调用时会传入四个参数 `accumulator` `value` `index|key` `collection`。
7
7
  *
8
8
  * @function
9
9
  * @alias module:Collection.reduceRight
10
10
  * @since 1.7.0
11
11
  * @param {ArrayLike<any> | Object} collection 要迭代的集合。
12
- * @param {Function} [iteratee=identity] 每次迭代调用的函数。
12
+ * @param {Function} [iteratee=identity] 每次迭代调用的函数。默认 `identity`。
13
13
  * @param {*} [initialValue] 初始值。
14
14
  * @returns {*} 累计值。
15
15
  * @example
package/types/round.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 根据精度四舍五入 `number` 。
2
+ * 根据精度四舍五入 `number`。
3
3
  *
4
4
  * 注:精度可以理解为保留几位小数。
5
5
  *
@@ -8,7 +8,7 @@
8
8
  * @since 1.0.0
9
9
  * @see {@link https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/round#小数舍入 小数舍入}
10
10
  * @param {number} number 要四舍五入的值。
11
- * @param {number} [precision=0] 四舍五入的精度。
11
+ * @param {number} [precision=0] 四舍五入的精度。默认 `0`。
12
12
  * @returns {number} 四舍五入的值。
13
13
  * @example
14
14
  *
package/types/sleep.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * @static
5
5
  * @alias module:Util.sleep
6
6
  * @since 1.0.0
7
- * @param {number} [ms=1000] 等待时间,单位毫秒。
7
+ * @param {number} [ms=1000] 等待时间,单位毫秒。默认 `1000`。
8
8
  * @returns {Promise<void>} 异步对象。
9
9
  * @example
10
10
  *
package/types/some.d.ts CHANGED
@@ -6,16 +6,16 @@ interface Some {
6
6
  <T extends object>(collection: WithNullable<T>, predicate?: ObjectIterator<T, any>): boolean;
7
7
  }
8
8
  /**
9
- * 迭代集合中的元素执行 `predicate` 函数,如果任一元素通过 `predicate` 返回真值,则停止迭代并返回 `true` ,否则返回 `false` 。
9
+ * 迭代集合中的元素执行 `predicate` 函数,如果任一元素通过 `predicate` 返回真值,则停止迭代并返回 `true`,否则返回 `false`。
10
10
  *
11
- * `predicate` 调用时会传入三个参数 `value` `index|key` `collection` 。
11
+ * `predicate` 调用时会传入三个参数 `value` `index|key` `collection`。
12
12
  *
13
13
  * @function
14
14
  * @alias module:Collection.some
15
15
  * @since 1.7.0
16
16
  * @param {ArrayLike<any> | Object} collection 要迭代的集合。
17
- * @param {function} [predicate=identity] 每次迭代调用的函数。
18
- * @returns {boolean} 如果任一元素通过 `predicate` 测试,则返回 `true` ,否则返回 `false` 。
17
+ * @param {function} [predicate=identity] 每次迭代调用的函数。默认 `identity`。
18
+ * @returns {boolean} 如果任一元素通过 `predicate` 测试,则返回 `true`,否则返回 `false`。
19
19
  * @example
20
20
  *
21
21
  * const arr = [1, 2, 3, 4, 5, 6];
@@ -11,8 +11,8 @@ import { FunctionAny } from './internals/types';
11
11
  * @alias module:Function.throttle
12
12
  * @since 1.0.0
13
13
  * @param {Function} func 要节流的函数。
14
- * @param {number} [wait=0] 需要节流的毫秒数。
15
- * @param {boolean} [immediate=true] 是否在节流开始前调用。
14
+ * @param {number} [wait=0] 需要节流的毫秒数。默认 `0`。
15
+ * @param {boolean} [immediate=true] 是否在节流开始前调用。默认 `true`。
16
16
  * @returns 节流函数。
17
17
  * @example
18
18
  *
package/types/times.d.ts CHANGED
@@ -5,13 +5,13 @@ interface Times {
5
5
  /**
6
6
  * 调用 `iteratee` `n` 次,每次调用返回的结果存入到数组中。
7
7
  *
8
- * `iteratee` 调用传入一个参数 `index` 。
8
+ * `iteratee` 调用传入一个参数 `index`。
9
9
  *
10
10
  * @function
11
11
  * @alias module:Util.times
12
12
  * @since 1.0.0
13
13
  * @param {number} n 调用 `iteratee` 的次数。
14
- * @param {Function} [iteratee=identity] 每次迭代调用的函数。
14
+ * @param {Function} [iteratee=identity] 每次迭代调用的函数。默认 `identity`。
15
15
  * @returns {Array} 调用结果的数组。
16
16
  * @example
17
17
  *
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 转换 `value` 为一个整数。
3
3
  *
4
- * 注意: 这个方法基于 [ToIntegerOrInfinity](https://tc39.es/ecma262/#sec-tointegerorinfinity) ,区别在于 `-0` 会返回 `-0` 。
4
+ * 注意: 这个方法基于 [ToIntegerOrInfinity](https://tc39.es/ecma262/#sec-tointegerorinfinity) ,区别在于 `-0` 会返回 `-0`。
5
5
  *
6
6
  * @static
7
7
  * @alias module:Util.toInteger
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 转换 `value` 为字符串。`null` 和 `undefined` 将返回空字符串。`-0` 将被转换为 `"-0"` 。
2
+ * 转换 `value` 为字符串。`null` 和 `undefined` 将返回空字符串。`-0` 将被转换为 `"-0"`。
3
3
  *
4
4
  * @static
5
5
  * @alias module:Util.toString
package/types/union.d.ts CHANGED
@@ -2,7 +2,7 @@ import { IterateeParam } from './internals/types';
2
2
  /**
3
3
  * 创建一个按顺序排列的唯一值的数组(并集)。如果传入迭代函数,会调用数组的每个元素以产生唯一性计算的标准。与 [`uniq`](#.uniq) 相似。
4
4
  *
5
- * `iteratee` 调用时会传入一个参数 `value` 。
5
+ * `iteratee` 调用时会传入一个参数 `value`。
6
6
  *
7
7
  * 默认使用了 [`SameValueZero`](https://tc39.es/ecma262/#sec-samevaluezero) 做等值比较。如果 `strictCheck=true` 将使用 [`SameValue`](https://tc39.es/ecma262/#sec-samevalue) 做等值比较。
8
8
  *
@@ -12,7 +12,7 @@ import { IterateeParam } from './internals/types';
12
12
  * @param {Array} array 要检查的数组。
13
13
  * @param {Array} [other=[]] 另一个要检查的数组。
14
14
  * @param {Function | string | number | Symbol} [iteratee] 迭代函数,调用每个元素。
15
- * @param {boolean} [strictCheck=false] 严格比较,区分 `0` `-0`,默认 `false` 。
15
+ * @param {boolean} [strictCheck=false] 严格比较,区分 `0` `-0`。默认 `false`。
16
16
  * @returns {Array} 新的联合数组。
17
17
  * @example
18
18
  *
package/types/uniq.d.ts CHANGED
@@ -2,7 +2,7 @@ import { IterateeParam } from './internals/types';
2
2
  /**
3
3
  * 创建一个去重后的数组副本。只有第一次出现的元素才会被保留。如果传入迭代函数,会调用数组的每个元素以产生唯一性计算的标准。
4
4
  *
5
- * `iteratee` 调用时会传入一个参数 `value` 。
5
+ * `iteratee` 调用时会传入一个参数 `value`。
6
6
  *
7
7
  * 默认使用了 [`SameValueZero`](https://tc39.es/ecma262/#sec-samevaluezero) 做等值比较。如果 `strictCheck=true` 将使用 [`SameValue`](https://tc39.es/ecma262/#sec-samevalue) 做等值比较。
8
8
  *
@@ -11,7 +11,7 @@ import { IterateeParam } from './internals/types';
11
11
  * @since 1.0.0
12
12
  * @param {Array} array 要检查的数组。
13
13
  * @param {Function | string | number | Symbol} [iteratee] 迭代函数,调用每个元素。
14
- * @param {boolean} [strictCheck=false] 严格比较,区分 `0` `-0`,默认 `false` 。
14
+ * @param {boolean} [strictCheck=false] 严格比较,区分 `0` `-0`。默认 `false`。
15
15
  * @returns {Array} 去重后的新数组。
16
16
  * @example
17
17
  *
@@ -1,10 +1,10 @@
1
1
  /**
2
- * 生成唯一ID。如果提供了 `prefix` ,会被添加到ID前缀上。
2
+ * 生成唯一ID。如果提供了 `prefix`,会被添加到ID前缀上。
3
3
  *
4
4
  * @static
5
5
  * @alias module:Util.uniqueId
6
6
  * @since 1.0.0
7
- * @param {string} [prefix] 要添加到ID前缀的值,默认 `"_" + 2个随机生成的字符`。
7
+ * @param {string} [prefix] 要添加到ID前缀的值。默认 `"_" + 2个随机生成的字符`。
8
8
  * @returns {string} 唯一ID。
9
9
  * @example
10
10
  *
package/types/words.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * @since 1.0.0
7
7
  * @see {@link https://zh.wikipedia.org/wiki/ASCII ASCII}
8
8
  * @param {string} string 要拆分的字符串。
9
- * @param {RegExp | string} [pattern=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g] 匹配模式。
9
+ * @param {RegExp | string} [pattern=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g] 匹配模式。默认 `/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g`。
10
10
  * @returns {string[]} 拆分后的数组。
11
11
  * @example
12
12
  *
package/types/xor.d.ts CHANGED
@@ -2,7 +2,7 @@ import { IterateeParam } from './internals/types';
2
2
  /**
3
3
  * 创建一个唯一值的数组(并集-交集),该数组包含两个数组参数中不相同的元素。如果传入迭代函数,会调用数组的每个元素以产生唯一性计算的标准。
4
4
  *
5
- * `iteratee` 调用时会传入一个参数 `value` 。
5
+ * `iteratee` 调用时会传入一个参数 `value`。
6
6
  *
7
7
  * 默认使用了 [`SameValueZero`](https://tc39.es/ecma262/#sec-samevaluezero) 做等值比较。如果 `strictCheck=true` 将使用 [`SameValue`](https://tc39.es/ecma262/#sec-samevalue) 做等值比较。
8
8
  *
@@ -11,8 +11,8 @@ import { IterateeParam } from './internals/types';
11
11
  * @since 1.0.0
12
12
  * @param {Array} array 要检查的数组。
13
13
  * @param {Array} [other=[]] 另一个要检查的数组。
14
- * @param {Function | string | number | Symbol} [iteratee={@link https://caijf.github.io/ut2/module-Util.html#.identity identity}] 迭代函数,调用每个元素。
15
- * @param {boolean} [strictCheck=false] 严格比较,区分 `0` `-0`,默认 `false` 。
14
+ * @param {Function | string | number | Symbol} [iteratee=identity] 迭代函数,调用每个元素。默认 `identity`。
15
+ * @param {boolean} [strictCheck=false] 严格比较,区分 `0` `-0`。默认 `false`。
16
16
  * @returns {Array} 过滤值后的新数组。
17
17
  * @example
18
18
  *