ut2 1.5.3 → 1.5.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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  一个现代 JavaScript 实用工具库。[点击查看在线文档]。
4
4
 
5
- [![npm][npm]][npm-url] [![Build and Deploy Docs](https://github.com/caijf/ut2/actions/workflows/ci.yml/badge.svg)](https://github.com/caijf/ut2/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/caijf/ut2/branch/main/graph/badge.svg?token=XKTS0H7085)](https://codecov.io/gh/caijf/ut2) ![npm](https://img.shields.io/npm/dt/ut2) ![GitHub](https://img.shields.io/github/license/caijf/ut2.svg)
5
+ [![npm][npm]][npm-url] [![Build and Deploy Docs](https://github.com/caijf/ut2/actions/workflows/ci.yml/badge.svg)](https://github.com/caijf/ut2/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/caijf/ut2/branch/main/graph/badge.svg?token=XKTS0H7085)](https://codecov.io/gh/caijf/ut2) [![Static Badge](https://img.shields.io/badge/benchmark-online-green)](https://codesandbox.io/s/github/caijf/ut2/tree/main/benchmark) ![npm](https://img.shields.io/npm/dt/ut2) ![GitHub](https://img.shields.io/github/license/caijf/ut2.svg)
6
6
 
7
7
  ## 比较
8
8
 
package/dist/ut2.js CHANGED
@@ -495,7 +495,7 @@
495
495
  return value == null || value !== value ? defaultValue : value;
496
496
  }
497
497
 
498
- var VERSION = "1.5.3";
498
+ var VERSION = "1.5.4";
499
499
  var supportedArgumentsType = getTag((function () { return arguments; })()) === argumentsTag;
500
500
  var FUNC_ERROR_TEXT = 'Expected a function';
501
501
  function toSource(func) {
@@ -1033,6 +1033,7 @@
1033
1033
  otherStack.pop();
1034
1034
  return result;
1035
1035
  }
1036
+
1036
1037
  function isEqual(value, other, customizer, strictCheck) {
1037
1038
  if (strictCheck === void 0) { strictCheck = false; }
1038
1039
  if (typeof customizer === 'function') {
@@ -1078,8 +1079,7 @@
1078
1079
  function isDeepComparable(object, source) {
1079
1080
  return getTag(object) === objectTag && getTag(source) === objectTag;
1080
1081
  }
1081
- function baseIsMatch(object, source, customizer, strictCheck, objStack, srcStack, executedCustomizer) {
1082
- if (executedCustomizer === void 0) { executedCustomizer = false; }
1082
+ function baseIsMatch(object, source, customizer, strictCheck, objStack, srcStack) {
1083
1083
  var hasCustomizer = typeof customizer === 'function';
1084
1084
  if (isDeepComparable(object, source)) {
1085
1085
  objStack = objStack || [];
@@ -1108,7 +1108,7 @@
1108
1108
  continue;
1109
1109
  }
1110
1110
  }
1111
- if (!baseIsMatch(object[key], source[key], customizer, strictCheck, objStack, srcStack, true)) {
1111
+ if (!baseIsMatch(object[key], source[key], customizer, strictCheck, objStack, srcStack)) {
1112
1112
  return false;
1113
1113
  }
1114
1114
  }
@@ -1116,18 +1116,17 @@
1116
1116
  srcStack.pop();
1117
1117
  return true;
1118
1118
  }
1119
- var result = isEqual(object, source, function (objValue, srcValue, k, obj, src) {
1120
- if (!executedCustomizer && hasCustomizer) {
1119
+ var result = isEqualDeep(object, source, function (objValue, srcValue, k, obj, src) {
1120
+ if (hasCustomizer) {
1121
1121
  var compared = customizer(objValue, srcValue, k, obj, src, objStack, srcStack);
1122
1122
  if (compared !== undefined) {
1123
1123
  return compared;
1124
1124
  }
1125
1125
  }
1126
- executedCustomizer = false;
1127
1126
  if (isDeepComparable(objValue, srcValue)) {
1128
1127
  return baseIsMatch(objValue, srcValue, customizer, strictCheck, objStack, srcStack);
1129
1128
  }
1130
- }, strictCheck);
1129
+ }, strictCheck, objStack, srcStack);
1131
1130
  return result;
1132
1131
  }
1133
1132
  function isMatch(object, source, customizer, strictCheck) {
@@ -1138,7 +1137,7 @@
1138
1137
  return !!compared;
1139
1138
  }
1140
1139
  }
1141
- return baseIsMatch(object, source, customizer, strictCheck, undefined, undefined, true);
1140
+ return baseIsMatch(object, source, customizer, strictCheck, undefined, undefined);
1142
1141
  }
1143
1142
 
1144
1143
  function isNumber(value) {