ut2 1.9.1 → 1.9.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/README.md +2 -2
- package/dist/ut2.js +6 -12
- package/dist/ut2.js.map +1 -1
- package/dist/ut2.min.js +1 -1
- package/dist/ut2.min.js.map +1 -1
- package/es/clamp.js +1 -2
- package/es/conforms.js +1 -2
- package/es/conformsTo.js +1 -2
- package/es/countBy.js +1 -2
- package/es/curry.js +1 -2
- package/es/defaultTo.js +1 -2
- package/es/escapeRegExp.js +1 -3
- package/es/every.js +1 -2
- package/es/filter.js +1 -2
- package/es/find.js +1 -2
- package/es/forEach.js +1 -2
- package/es/forEachRight.js +1 -2
- package/es/fromPairs.js +1 -2
- package/es/groupBy.js +1 -2
- package/es/gt.js +1 -2
- package/es/gte.js +1 -2
- package/es/internals/helpers.js +1 -1
- package/es/internals/root.js +1 -2
- package/es/isPlainObject.js +1 -1
- package/es/keyBy.js +1 -2
- package/es/lowerFirst.js +1 -2
- package/es/lt.js +1 -2
- package/es/lte.js +1 -2
- package/es/map.js +1 -2
- package/es/max.js +1 -2
- package/es/min.js +1 -2
- package/es/omit.js +1 -2
- package/es/orderBy.js +1 -2
- package/es/partial.js +1 -2
- package/es/partition.js +1 -2
- package/es/pick.js +1 -2
- package/es/random.js +1 -1
- package/es/randomInt.js +1 -1
- package/es/range.js +1 -2
- package/es/reduce.js +1 -2
- package/es/reduceRight.js +1 -2
- package/es/some.js +1 -2
- package/es/times.js +1 -2
- package/es/toNumber.js +1 -5
- package/es/uniqueId.js +3 -5
- package/es/upperFirst.js +1 -2
- package/lib/clamp.js +1 -2
- package/lib/conforms.js +1 -2
- package/lib/conformsTo.js +1 -2
- package/lib/countBy.js +1 -2
- package/lib/curry.js +1 -2
- package/lib/defaultTo.js +1 -2
- package/lib/escapeRegExp.js +1 -3
- package/lib/every.js +1 -2
- package/lib/filter.js +1 -2
- package/lib/find.js +1 -2
- package/lib/forEach.js +1 -2
- package/lib/forEachRight.js +1 -2
- package/lib/fromPairs.js +1 -2
- package/lib/groupBy.js +1 -2
- package/lib/gt.js +1 -2
- package/lib/gte.js +1 -2
- package/lib/index.js +4 -16
- package/lib/internals/comparator.js +8 -4
- package/lib/internals/helpers.js +10 -5
- package/lib/internals/native.js +106 -53
- package/lib/internals/nodeUtil.js +13 -6
- package/lib/internals/root.js +1 -2
- package/lib/keyBy.js +1 -2
- package/lib/lowerFirst.js +1 -2
- package/lib/lt.js +1 -2
- package/lib/lte.js +1 -2
- package/lib/map.js +1 -2
- package/lib/max.js +1 -2
- package/lib/min.js +1 -2
- package/lib/omit.js +1 -2
- package/lib/orderBy.js +1 -2
- package/lib/partial.js +1 -2
- package/lib/partition.js +1 -2
- package/lib/pick.js +1 -2
- package/lib/range.js +1 -2
- package/lib/reduce.js +1 -2
- package/lib/reduceRight.js +1 -2
- package/lib/some.js +1 -2
- package/lib/times.js +1 -2
- package/lib/toNumber.js +1 -5
- package/lib/uniqueId.js +3 -5
- package/lib/upperFirst.js +1 -2
- package/package.json +2 -2
- package/types/camelCase.d.ts +1 -1
- package/types/ceil.d.ts +1 -1
- package/types/compact.d.ts +1 -1
- package/types/eq.d.ts +1 -1
- package/types/escape.d.ts +1 -1
- package/types/escapeRegExp.d.ts +1 -1
- package/types/floor.d.ts +1 -1
- package/types/internals/native.d.ts +3 -3
- package/types/isBlob.d.ts +2 -2
- package/types/isLength.d.ts +1 -1
- package/types/isObject.d.ts +1 -1
- package/types/isTypedArray.d.ts +1 -1
- package/types/kebabCase.d.ts +1 -1
- package/types/merge.d.ts +1 -1
- package/types/orderBy.d.ts +1 -1
- package/types/pascalCase.d.ts +1 -1
- package/types/random.d.ts +10 -6
- package/types/randomInt.d.ts +9 -5
- package/types/round.d.ts +1 -1
- package/types/snakeCase.d.ts +1 -1
- package/types/toLength.d.ts +1 -1
- package/types/uniqueId.d.ts +3 -3
- package/types/words.d.ts +1 -1
- package/types/xor.d.ts +1 -1
package/README.md
CHANGED
|
@@ -151,10 +151,10 @@ const debounced = debounce(() => {
|
|
|
151
151
|
- [Object](https://caijf.github.io/ut2/module-Object.html) 对象
|
|
152
152
|
- [allKeys](https://caijf.github.io/ut2/module-Object.html#.allKeys) - 对象自身的可枚举属性(包含 `Symbol` 属性)。
|
|
153
153
|
- [allKeysIn](https://caijf.github.io/ut2/module-Object.html#.allKeysIn) - 对象自身及继承的可枚举属性(包含 `Symbol` 属性)。
|
|
154
|
-
- [invert](https://caijf.github.io/ut2/module-Object.html#.invert) -
|
|
154
|
+
- [invert](https://caijf.github.io/ut2/module-Object.html#.invert) - 对象自身的可枚举属性(包含 `Symbol` 属性)和值反转。
|
|
155
155
|
- [keys](https://caijf.github.io/ut2/module-Object.html#.keys) - 对象自身的可枚举属性(不包含 `Symbol` 属性)。
|
|
156
156
|
- [keysIn](https://caijf.github.io/ut2/module-Object.html#.keysIn) - 对象自身及继承的可枚举属性(不包含 `Symbol` 属性)。
|
|
157
|
-
- [merge](https://caijf.github.io/ut2/module-Object.html#.merge) -
|
|
157
|
+
- [merge](https://caijf.github.io/ut2/module-Object.html#.merge) - 递归对象自身的可枚举属性(包含 `Symbol` 属性)或数组进行合并。
|
|
158
158
|
- [omit](https://caijf.github.io/ut2/module-Object.html#.omit) - 排除部分属性。
|
|
159
159
|
- [omitBy](https://caijf.github.io/ut2/module-Object.html#.omitBy) - 根据方法,排除部分属性。
|
|
160
160
|
- [pick](https://caijf.github.io/ut2/module-Object.html#.pick) - 选择部分属性。
|
package/dist/ut2.js
CHANGED
|
@@ -93,11 +93,7 @@
|
|
|
93
93
|
}
|
|
94
94
|
value = value.trim();
|
|
95
95
|
var isBinary = reIsBinary.test(value);
|
|
96
|
-
return isBinary || reIsOctal.test(value)
|
|
97
|
-
? parseInt(value.slice(2), isBinary ? 2 : 8)
|
|
98
|
-
: reIsBadHex.test(value)
|
|
99
|
-
? NaN
|
|
100
|
-
: +value;
|
|
96
|
+
return isBinary || reIsOctal.test(value) ? parseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NaN : +value;
|
|
101
97
|
}
|
|
102
98
|
|
|
103
99
|
function toInteger(value) {
|
|
@@ -605,7 +601,7 @@
|
|
|
605
601
|
return value == null || value !== value ? defaultValue : value;
|
|
606
602
|
};
|
|
607
603
|
|
|
608
|
-
var VERSION = "1.9.
|
|
604
|
+
var VERSION = "1.9.2";
|
|
609
605
|
var supportedArgumentsType = getTag((function () { return arguments; })()) === argumentsTag;
|
|
610
606
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
611
607
|
function toSource(func) {
|
|
@@ -1603,9 +1599,7 @@
|
|
|
1603
1599
|
var reRegExpChar = /[\\^$.*+?\-()[\]{}|]/g;
|
|
1604
1600
|
var reHasRegExpChar = RegExp(reRegExpChar.source);
|
|
1605
1601
|
function escapeRegExp(string) {
|
|
1606
|
-
return string && reHasRegExpChar.test(string)
|
|
1607
|
-
? string.replace(reRegExpChar, '\\$&')
|
|
1608
|
-
: string || '';
|
|
1602
|
+
return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, '\\$&') : string || '';
|
|
1609
1603
|
}
|
|
1610
1604
|
|
|
1611
1605
|
function kebabCase(string, pattern) {
|
|
@@ -1765,10 +1759,10 @@
|
|
|
1765
1759
|
}
|
|
1766
1760
|
|
|
1767
1761
|
var idCounter = 0;
|
|
1762
|
+
var defaultPrefix = '_' + Math.random().toString(36).substring(2, 4);
|
|
1768
1763
|
function uniqueId(prefix) {
|
|
1769
|
-
if (prefix === void 0) { prefix =
|
|
1770
|
-
|
|
1771
|
-
return toString(prefix) + id;
|
|
1764
|
+
if (prefix === void 0) { prefix = defaultPrefix; }
|
|
1765
|
+
return '' + prefix + ++idCounter;
|
|
1772
1766
|
}
|
|
1773
1767
|
|
|
1774
1768
|
exports.MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH;
|