ut2 1.17.0 → 1.18.0
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 +1 -0
- package/dist/ut2.js +13 -8
- package/dist/ut2.js.map +1 -1
- package/dist/ut2.min.js +1 -1
- package/dist/ut2.min.js.map +1 -1
- package/es/equalArrayLike.js +19 -0
- package/es/index.js +1 -0
- package/es/internals/helpers.js +1 -1
- package/es/memoize.js +2 -13
- package/lib/equalArrayLike.js +21 -0
- package/lib/index.js +2 -0
- package/lib/internals/helpers.js +1 -1
- package/lib/memoize.js +2 -13
- package/package.json +1 -1
- package/types/equalArrayLike.d.ts +37 -0
- package/types/index.d.ts +1 -0
- package/types/memoize.d.ts +1 -1
- package/types/uniqueId.d.ts +5 -1
package/README.md
CHANGED
|
@@ -190,6 +190,7 @@ const debounced = debounce(() => {
|
|
|
190
190
|
- [constant](https://caijf.github.io/ut2/module-Util.html#.constant) - 返回自身的函数。
|
|
191
191
|
- [defaultTo](https://caijf.github.io/ut2/module-Util.html#.defaultTo) - 默认值。
|
|
192
192
|
- [eq](https://caijf.github.io/ut2/module-Util.html#.eq) - 等于。
|
|
193
|
+
- [equalArrayLike](https://caijf.github.io/ut2/module-Util.html#.equalArrayLike) - 比较类数组。
|
|
193
194
|
- [gt](https://caijf.github.io/ut2/module-Util.html#.gt) - 大于。
|
|
194
195
|
- [gte](https://caijf.github.io/ut2/module-Util.html#.gte) - 大于等于。
|
|
195
196
|
- [guard](https://caijf.github.io/ut2/module-Util.html#.guard) - 函数守卫。
|
package/dist/ut2.js
CHANGED
|
@@ -607,7 +607,7 @@
|
|
|
607
607
|
return value == null || value !== value ? defaultValue : value;
|
|
608
608
|
};
|
|
609
609
|
|
|
610
|
-
var VERSION = "1.
|
|
610
|
+
var VERSION = "1.18.0";
|
|
611
611
|
var isBrowser = typeof window !== stringUndefined && isObjectLike(window) && typeof document !== stringUndefined && isObjectLike(document) && window.document === document;
|
|
612
612
|
var supportedArgumentsType = getTag((function () { return arguments; })()) === argumentsTag;
|
|
613
613
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
@@ -784,21 +784,25 @@
|
|
|
784
784
|
}, wait);
|
|
785
785
|
}
|
|
786
786
|
|
|
787
|
-
function
|
|
788
|
-
if (
|
|
787
|
+
function equalArrayLike(arg1, arg2, strictCheck) {
|
|
788
|
+
if (strictCheck === void 0) { strictCheck = true; }
|
|
789
|
+
if (eq(arg1, arg2, strictCheck))
|
|
790
|
+
return true;
|
|
791
|
+
if (!isArrayLike(arg1) || !isArrayLike(arg2))
|
|
789
792
|
return false;
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
+
if (arg1.length !== arg2.length)
|
|
794
|
+
return false;
|
|
795
|
+
for (var i = 0; i < arg1.length; i++) {
|
|
796
|
+
if (!eq(arg1[i], arg2[i], strictCheck))
|
|
793
797
|
return false;
|
|
794
|
-
}
|
|
795
798
|
}
|
|
796
799
|
return true;
|
|
797
800
|
}
|
|
801
|
+
|
|
798
802
|
function memoize(func, options) {
|
|
799
803
|
var opts = options || {};
|
|
800
804
|
var max = mathCeil(opts.max || 0);
|
|
801
|
-
var isEqual = typeof opts.isEqual === 'function' ? opts.isEqual :
|
|
805
|
+
var isEqual = typeof opts.isEqual === 'function' ? opts.isEqual : equalArrayLike;
|
|
802
806
|
var cache = [];
|
|
803
807
|
function memoized() {
|
|
804
808
|
var _this = this;
|
|
@@ -2198,6 +2202,7 @@
|
|
|
2198
2202
|
exports.delay = delay;
|
|
2199
2203
|
exports.difference = difference;
|
|
2200
2204
|
exports.eq = eq;
|
|
2205
|
+
exports.equalArrayLike = equalArrayLike;
|
|
2201
2206
|
exports.escape = escape;
|
|
2202
2207
|
exports.escapeRegExp = escapeRegExp;
|
|
2203
2208
|
exports.every = every;
|