ut2 1.2.0 → 1.2.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.
package/es/eq.js CHANGED
@@ -1,9 +1,9 @@
1
1
  function eq(value, other, strictCheck) {
2
2
  if (strictCheck === void 0) { strictCheck = false; }
3
- if (strictCheck) {
4
- return Object.is(value, other);
3
+ if (value === other) {
4
+ return strictCheck ? value !== 0 || 1 / value === 1 / other : true;
5
5
  }
6
- return value === other || (value !== value && other !== other);
6
+ return value !== value && other !== other;
7
7
  }
8
8
 
9
9
  export { eq as default };
@@ -8,6 +8,6 @@ var numberIsInteger = Number.isInteger;
8
8
  var numberIsSafeInteger = Number.isSafeInteger;
9
9
  var objectGetOwnPropertySymbols = Object.getOwnPropertySymbols;
10
10
  var arrayAt = Array.prototype.at;
11
- var VERSION = "1.2.0";
11
+ var VERSION = "1.2.2";
12
12
 
13
13
  export { FUNC_ERROR_TEXT, VERSION, argType, arrayAt, numberIsFinite, numberIsInteger, numberIsSafeInteger, objectGetOwnPropertySymbols, supportedArgumentsType };
package/es/merge.js CHANGED
@@ -12,9 +12,7 @@ function baseMerge(object, source, customizer, storage) {
12
12
  var keys = allKeysIn(source);
13
13
  keys.forEach(function (key) {
14
14
  var srcValue = source[key];
15
- var newValue = typeof customizer === 'function'
16
- ? customizer(obj[key], srcValue, key, obj, source)
17
- : undefined;
15
+ var newValue = typeof customizer === 'function' ? customizer(obj[key], srcValue, key, obj, source) : undefined;
18
16
  if (newValue === undefined) {
19
17
  newValue = srcValue;
20
18
  }
package/es/orderBy.js CHANGED
@@ -9,9 +9,7 @@ function orderBy(collection, iteratees, orders) {
9
9
  orders = (isArray(orders) ? orders : orders !== undefined ? [orders] : []);
10
10
  if (isArray(collection)) {
11
11
  collection.forEach(function (item, index) {
12
- var criteria = iteratees.map(function (iteratee) {
13
- return createIteratee(iteratee)(item);
14
- });
12
+ var criteria = iteratees.map(function (iteratee) { return createIteratee(iteratee)(item); });
15
13
  result.push({
16
14
  criteria: criteria,
17
15
  index: index,
@@ -19,9 +17,7 @@ function orderBy(collection, iteratees, orders) {
19
17
  });
20
18
  });
21
19
  }
22
- return result
23
- .sort(function (a, b) { return compareMultiple(a, b, orders); })
24
- .map(function (item) { return item.value; });
20
+ return result.sort(function (a, b) { return compareMultiple(a, b, orders); }).map(function (item) { return item.value; });
25
21
  }
26
22
 
27
23
  export { orderBy as default };
package/lib/eq.js CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  function eq(value, other, strictCheck) {
4
4
  if (strictCheck === void 0) { strictCheck = false; }
5
- if (strictCheck) {
6
- return Object.is(value, other);
5
+ if (value === other) {
6
+ return strictCheck ? value !== 0 || 1 / value === 1 / other : true;
7
7
  }
8
- return value === other || (value !== value && other !== other);
8
+ return value !== value && other !== other;
9
9
  }
10
10
 
11
11
  module.exports = eq;
@@ -10,4 +10,4 @@ exports.numberIsInteger = Number.isInteger;
10
10
  exports.numberIsSafeInteger = Number.isSafeInteger;
11
11
  exports.objectGetOwnPropertySymbols = Object.getOwnPropertySymbols;
12
12
  exports.arrayAt = Array.prototype.at;
13
- exports.VERSION = "1.2.0";
13
+ exports.VERSION = "1.2.2";
package/lib/merge.js CHANGED
@@ -14,9 +14,7 @@ function baseMerge(object, source, customizer, storage) {
14
14
  var keys = allKeysIn(source);
15
15
  keys.forEach(function (key) {
16
16
  var srcValue = source[key];
17
- var newValue = typeof customizer === 'function'
18
- ? customizer(obj[key], srcValue, key, obj, source)
19
- : undefined;
17
+ var newValue = typeof customizer === 'function' ? customizer(obj[key], srcValue, key, obj, source) : undefined;
20
18
  if (newValue === undefined) {
21
19
  newValue = srcValue;
22
20
  }
package/lib/orderBy.js CHANGED
@@ -11,9 +11,7 @@ function orderBy(collection, iteratees, orders) {
11
11
  orders = (isArray(orders) ? orders : orders !== undefined ? [orders] : []);
12
12
  if (isArray(collection)) {
13
13
  collection.forEach(function (item, index) {
14
- var criteria = iteratees.map(function (iteratee) {
15
- return createIteratee(iteratee)(item);
16
- });
14
+ var criteria = iteratees.map(function (iteratee) { return createIteratee(iteratee)(item); });
17
15
  result.push({
18
16
  criteria: criteria,
19
17
  index: index,
@@ -21,9 +19,7 @@ function orderBy(collection, iteratees, orders) {
21
19
  });
22
20
  });
23
21
  }
24
- return result
25
- .sort(function (a, b) { return compare.compareMultiple(a, b, orders); })
26
- .map(function (item) { return item.value; });
22
+ return result.sort(function (a, b) { return compare.compareMultiple(a, b, orders); }).map(function (item) { return item.value; });
27
23
  }
28
24
 
29
25
  module.exports = orderBy;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ut2",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "author": "caijf",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -7,7 +7,7 @@
7
7
  * @alias module:Collection.countBy
8
8
  * @since 1.0.0
9
9
  * @param {Array} collection 一个用来迭代的集合。
10
- * @param {Function|string} [iteratee] 迭代函数,用来转换键。
10
+ * @param {Function | string} [iteratee] 迭代函数,用来转换键。
11
11
  * @returns {Object} 组成集合对象。
12
12
  * @example
13
13
  *
package/types/eq.d.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  * @returns {boolean} 如果两个值相等,返回 `true` ,否则返回 `false` 。
14
14
  * @example
15
15
  *
16
- * eq(0, -0); // true
16
+ * eq(-0, 0); // true
17
17
  *
18
18
  * eq(1, 1); // true
19
19
  *
@@ -7,7 +7,7 @@
7
7
  * @alias module:Collection.groupBy
8
8
  * @since 1.0.0
9
9
  * @param {Array} collection 一个用来迭代的集合。
10
- * @param {Function|string} [iteratee] 迭代函数,用来转换键。
10
+ * @param {Function | string} [iteratee] 迭代函数,用来转换键。
11
11
  * @returns {Object} 组成聚合对象。
12
12
  * @example
13
13
  *
@@ -2,9 +2,9 @@
2
2
  * 数字调整。
3
3
  *
4
4
  * @private
5
- * @param {'floor'|'ceil'|'round'} type 调整的类型。
6
- * @param {number} value 要调整的数字。
7
- * @param {number} precision 指数(调整基数的10个对数)。
5
+ * @param {'floor' | 'ceil' | 'round'} type 调整的类型。
6
+ * @param {number} value 要调整的数字。
7
+ * @param {number} precision 指数(调整基数的10个对数)。
8
8
  * @returns {number} 调整后的数字。
9
9
  */
10
10
  declare function decimalAdjust(type: 'floor' | 'ceil' | 'round', value: number, precision?: number): number;
@@ -4,7 +4,7 @@
4
4
  * @private
5
5
  * @since 1.0.0
6
6
  * @param {*} value 检查值
7
- * @param {string|string[]} type 类型名称
7
+ * @param {string | string[]} type 类型名称
8
8
  * @returns {boolean} 返回值类型是否匹配
9
9
  */
10
10
  declare function isType(value: any, type: string | string[]): boolean;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @private
5
5
  * @param {string} string 要拆分的字符串。
6
- * @param {RegExp|string} [pattern] 拆分词组的匹配模式。
6
+ * @param {RegExp | string} [pattern] 拆分词组的匹配模式。
7
7
  * @returns {string[]} 拆分后的数组。
8
8
  */
9
9
  declare function splitCaseWords(string: string, pattern?: RegExp | string): string[];
@@ -6,7 +6,7 @@
6
6
  * @since 1.0.0
7
7
  * @see {@link https://en.wikipedia.org/wiki/Letter_case#Special_case_styles | kebab case}
8
8
  * @param {string} string 要转换的字符串。
9
- * @param {RegExp|string} [pattern] 拆分词组的匹配模式。
9
+ * @param {RegExp | string} [pattern] 拆分词组的匹配模式。
10
10
  * @returns {string} 转换后的字符串。
11
11
  * @example
12
12
  *
package/types/keyBy.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * @alias module:Collection.keyBy
8
8
  * @since 1.0.0
9
9
  * @param {Array} collection 一个用来迭代的集合。
10
- * @param {Function|string} [iteratee] 迭代函数,用来转换键。
10
+ * @param {Function | string} [iteratee] 迭代函数,用来转换键。
11
11
  * @returns {Object} 组成聚合对象。
12
12
  * @example
13
13
  *
@@ -5,7 +5,7 @@
5
5
  * @alias module:String.lowerCase
6
6
  * @since 1.0.0
7
7
  * @param {string} string 要转换的字符串。
8
- * @param {RegExp|string} [pattern] 拆分词组的匹配模式。
8
+ * @param {RegExp | string} [pattern] 拆分词组的匹配模式。
9
9
  * @returns {string} 小写字符串。
10
10
  * @example
11
11
  *
package/types/merge.d.ts CHANGED
@@ -7,8 +7,8 @@ type Customizer = (objValue: any, srcValue: any, key: string | symbol, object: a
7
7
  * @static
8
8
  * @alias module:Object.merge
9
9
  * @since 1.0.0
10
- * @param {Object|Array} object 目标对象。
11
- * @param {Object|Array} source 来源对象。
10
+ * @param {Object | Array} object 目标对象。
11
+ * @param {Object | Array} source 来源对象。
12
12
  * @param {Function} [customizer] 自定义赋值函数。
13
13
  * @returns {Object} 目标对象。
14
14
  * @example
package/types/omit.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * @alias module:Object.omit
6
6
  * @since 1.0.0
7
7
  * @param {Object} object 来源对象。
8
- * @param {string|string[]} [fields] 要被忽略的属性。
8
+ * @param {string | string[]} [fields] 要被忽略的属性。
9
9
  * @returns {Object} 新对象。
10
10
  * @example
11
11
  *
@@ -11,8 +11,8 @@ import { Order } from './internals/compare';
11
11
  * @since 1.0.0
12
12
  * @see {@link https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/sort | sort}
13
13
  * @param {Array} collection 一个用来迭代的集合。
14
- * @param {Function|string|Array} [iteratees] 排序的迭代函数。
15
- * @param {'asc'|'desc'|Array} [orders] 迭代函数的排序顺序。
14
+ * @param {Function | string | Array} [iteratees] 排序的迭代函数。
15
+ * @param {'asc' | 'desc' | Array} [orders] 迭代函数的排序顺序。
16
16
  * @returns {Array} 排序后的新数组。
17
17
  * @example
18
18
  *
@@ -7,7 +7,7 @@
7
7
  * @alias module:Collection.partition
8
8
  * @since 1.0.0
9
9
  * @param {Array} collection 一个用来迭代的集合。
10
- * @param {Function|string} [predicate=identity] 每次迭代调用的断言函数。
10
+ * @param {Function | string} [predicate=identity] 每次迭代调用的断言函数。
11
11
  * @returns {Array} 分组后的数组。
12
12
  * @example
13
13
  *
package/types/pick.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * @alias module:Object.pick
8
8
  * @since 1.0.0
9
9
  * @param {Object} object 来源对象。
10
- * @param {string|string[]} [fields] 选中的属性。
10
+ * @param {string | string[]} [fields] 选中的属性。
11
11
  * @returns {Object} 新对象。
12
12
  * @example
13
13
  *
@@ -6,7 +6,7 @@
6
6
  * @since 1.0.0
7
7
  * @see {@link https://en.wikipedia.org/wiki/Snake_case | snake case}
8
8
  * @param {string} string 要转换的字符串。
9
- * @param {RegExp|string} [pattern] 拆分词组的匹配模式。
9
+ * @param {RegExp | string} [pattern] 拆分词组的匹配模式。
10
10
  * @returns {string} 转换后的字符串。
11
11
  * @example
12
12
  *
package/types/uniq.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * @static
9
9
  * @alias module:Array.uniq
10
10
  * @since 1.0.0
11
- * @param {Array} array 要检查的数组。
11
+ * @param {Array} array 要检查的数组。
12
12
  * @param {Function | string} [iteratee] 迭代函数,调用每个元素。
13
13
  * @param {boolean} [strictCheck=false] 严格比较,区分 `+0` `-0`。
14
14
  * @returns {Array} 去重后的新数组。
@@ -5,7 +5,7 @@
5
5
  * @alias module:String.upperCase
6
6
  * @since 1.0.0
7
7
  * @param {string} string 要转换的字符串。
8
- * @param {RegExp|string} [pattern] 拆分词组的匹配模式。
8
+ * @param {RegExp | string} [pattern] 拆分词组的匹配模式。
9
9
  * @returns {string} 大写字符串。
10
10
  * @example
11
11
  *
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] 匹配模式。
10
10
  * @returns {string[]} 拆分后的数组。
11
11
  * @example
12
12
  *