ut2 1.9.3 → 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 (111) hide show
  1. package/dist/ut2.js +3 -6
  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/isBuffer.js +2 -5
  7. package/lib/internals/helpers.js +1 -1
  8. package/lib/isBuffer.js +2 -5
  9. package/package.json +1 -1
  10. package/types/after.d.ts +1 -1
  11. package/types/ceil.d.ts +2 -2
  12. package/types/chunk.d.ts +1 -1
  13. package/types/clamp.d.ts +3 -3
  14. package/types/conforms.d.ts +1 -1
  15. package/types/conformsTo.d.ts +2 -2
  16. package/types/countBy.d.ts +1 -1
  17. package/types/curry.d.ts +1 -1
  18. package/types/debounce.d.ts +2 -2
  19. package/types/defaultTo.d.ts +2 -2
  20. package/types/delay.d.ts +2 -2
  21. package/types/difference.d.ts +3 -3
  22. package/types/eq.d.ts +2 -2
  23. package/types/escapeRegExp.d.ts +1 -1
  24. package/types/every.d.ts +4 -4
  25. package/types/filter.d.ts +2 -2
  26. package/types/find.d.ts +3 -3
  27. package/types/floor.d.ts +2 -2
  28. package/types/forEach.d.ts +3 -3
  29. package/types/forEachRight.d.ts +3 -3
  30. package/types/groupBy.d.ts +2 -2
  31. package/types/gt.d.ts +2 -2
  32. package/types/gte.d.ts +2 -2
  33. package/types/identity.d.ts +1 -1
  34. package/types/inRange.d.ts +3 -3
  35. package/types/internals/getTag.d.ts +1 -1
  36. package/types/internals/isEqualDeep.d.ts +3 -3
  37. package/types/internals/native.d.ts +1 -1
  38. package/types/intersection.d.ts +3 -3
  39. package/types/invert.d.ts +2 -1
  40. package/types/isArguments.d.ts +1 -1
  41. package/types/isArray.d.ts +1 -1
  42. package/types/isArrayBuffer.d.ts +1 -1
  43. package/types/isArrayLike.d.ts +1 -1
  44. package/types/isArrayLikeObject.d.ts +6 -2
  45. package/types/isBigInt.d.ts +1 -1
  46. package/types/isBlob.d.ts +2 -2
  47. package/types/isBoolean.d.ts +1 -1
  48. package/types/isBuffer.d.ts +3 -3
  49. package/types/isDataView.d.ts +1 -1
  50. package/types/isDate.d.ts +1 -1
  51. package/types/isElement.d.ts +1 -1
  52. package/types/isEmpty.d.ts +1 -1
  53. package/types/isEqual.d.ts +3 -3
  54. package/types/isError.d.ts +3 -3
  55. package/types/isFinite.d.ts +2 -2
  56. package/types/isFunction.d.ts +3 -3
  57. package/types/isInteger.d.ts +2 -2
  58. package/types/isLength.d.ts +1 -1
  59. package/types/isMap.d.ts +1 -1
  60. package/types/isMatch.d.ts +3 -3
  61. package/types/isNaN.d.ts +2 -2
  62. package/types/isNil.d.ts +2 -2
  63. package/types/isNull.d.ts +2 -2
  64. package/types/isNumber.d.ts +1 -1
  65. package/types/isObject.d.ts +1 -1
  66. package/types/isObjectLike.d.ts +1 -1
  67. package/types/isPlainObject.d.ts +1 -1
  68. package/types/isPromiseLike.d.ts +1 -1
  69. package/types/isRegExp.d.ts +1 -1
  70. package/types/isSafeInteger.d.ts +2 -2
  71. package/types/isSet.d.ts +1 -1
  72. package/types/isString.d.ts +1 -1
  73. package/types/isSymbol.d.ts +1 -1
  74. package/types/isTypedArray.d.ts +1 -1
  75. package/types/isUndefined.d.ts +2 -2
  76. package/types/isWeakMap.d.ts +1 -1
  77. package/types/isWeakSet.d.ts +1 -1
  78. package/types/keyBy.d.ts +2 -2
  79. package/types/keys.d.ts +1 -1
  80. package/types/keysIn.d.ts +1 -1
  81. package/types/lt.d.ts +2 -2
  82. package/types/lte.d.ts +2 -2
  83. package/types/map.d.ts +2 -2
  84. package/types/max.d.ts +1 -1
  85. package/types/merge.d.ts +4 -4
  86. package/types/min.d.ts +1 -1
  87. package/types/noop.d.ts +1 -1
  88. package/types/nth.d.ts +1 -1
  89. package/types/nthArg.d.ts +1 -1
  90. package/types/omitBy.d.ts +3 -2
  91. package/types/orderBy.d.ts +1 -1
  92. package/types/partial.d.ts +1 -1
  93. package/types/partition.d.ts +5 -3
  94. package/types/pickBy.d.ts +3 -2
  95. package/types/random.d.ts +2 -2
  96. package/types/randomInt.d.ts +3 -3
  97. package/types/range.d.ts +3 -3
  98. package/types/reduce.d.ts +2 -2
  99. package/types/reduceRight.d.ts +2 -2
  100. package/types/round.d.ts +2 -2
  101. package/types/sleep.d.ts +1 -1
  102. package/types/some.d.ts +4 -4
  103. package/types/throttle.d.ts +2 -2
  104. package/types/times.d.ts +2 -2
  105. package/types/toInteger.d.ts +1 -1
  106. package/types/toString.d.ts +1 -1
  107. package/types/union.d.ts +2 -2
  108. package/types/uniq.d.ts +2 -2
  109. package/types/uniqueId.d.ts +2 -2
  110. package/types/words.d.ts +1 -1
  111. package/types/xor.d.ts +3 -3
@@ -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
  *