ut2 1.2.1 → 1.3.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.
Files changed (76) hide show
  1. package/README.md +36 -35
  2. package/dist/ut2.js +440 -264
  3. package/dist/ut2.js.map +1 -1
  4. package/dist/ut2.min.js +1 -1
  5. package/dist/ut2.min.js.map +1 -1
  6. package/es/eq.js +3 -5
  7. package/es/index.js +30 -29
  8. package/es/internals/compare.js +23 -6
  9. package/es/internals/getTag.js +7 -9
  10. package/es/internals/helpers.js +4 -4
  11. package/es/internals/native.js +17 -1
  12. package/es/isArguments.js +1 -3
  13. package/es/isArrayBuffer.js +1 -3
  14. package/es/isEqual.js +185 -0
  15. package/es/isSafeInteger.js +1 -3
  16. package/es/isTypedArray.js +1 -15
  17. package/lib/eq.js +3 -5
  18. package/lib/index.js +60 -58
  19. package/lib/internals/compare.js +23 -6
  20. package/lib/internals/getTag.js +6 -8
  21. package/lib/internals/helpers.js +3 -3
  22. package/lib/internals/native.js +16 -0
  23. package/lib/isArguments.js +1 -3
  24. package/lib/isArrayBuffer.js +1 -3
  25. package/lib/isEqual.js +187 -0
  26. package/lib/isSafeInteger.js +1 -3
  27. package/lib/isTypedArray.js +1 -15
  28. package/package.json +1 -1
  29. package/types/difference.d.ts +1 -1
  30. package/types/eq.d.ts +2 -2
  31. package/types/index.d.ts +42 -41
  32. package/types/internals/helpers.d.ts +0 -1
  33. package/types/internals/native.d.ts +16 -0
  34. package/types/intersection.d.ts +1 -1
  35. package/types/isArguments.d.ts +1 -1
  36. package/types/isArray.d.ts +1 -1
  37. package/types/isArrayBuffer.d.ts +1 -1
  38. package/types/isArrayLike.d.ts +1 -1
  39. package/types/isArrayLikeObject.d.ts +1 -1
  40. package/types/isBlob.d.ts +1 -1
  41. package/types/isBoolean.d.ts +1 -1
  42. package/types/isBuffer.d.ts +1 -1
  43. package/types/isDataView.d.ts +1 -1
  44. package/types/isDate.d.ts +1 -1
  45. package/types/isElement.d.ts +1 -1
  46. package/types/isEmpty.d.ts +1 -1
  47. package/types/isEqual.d.ts +44 -0
  48. package/types/isError.d.ts +1 -1
  49. package/types/isFinite.d.ts +1 -1
  50. package/types/isFunction.d.ts +1 -1
  51. package/types/isInteger.d.ts +1 -1
  52. package/types/isLength.d.ts +1 -1
  53. package/types/isMap.d.ts +1 -1
  54. package/types/isNaN.d.ts +1 -1
  55. package/types/isNil.d.ts +1 -1
  56. package/types/isNull.d.ts +1 -1
  57. package/types/isNumber.d.ts +1 -1
  58. package/types/isObject.d.ts +1 -1
  59. package/types/isObjectLike.d.ts +1 -1
  60. package/types/isPlainObject.d.ts +1 -1
  61. package/types/isPromiseLike.d.ts +1 -1
  62. package/types/isRegExp.d.ts +1 -1
  63. package/types/isSafeInteger.d.ts +1 -1
  64. package/types/isSet.d.ts +1 -1
  65. package/types/isString.d.ts +1 -1
  66. package/types/isSymbol.d.ts +1 -1
  67. package/types/isTypedArray.d.ts +1 -1
  68. package/types/isUndefined.d.ts +1 -1
  69. package/types/isWeakMap.d.ts +1 -1
  70. package/types/isWeakSet.d.ts +1 -1
  71. package/types/union.d.ts +1 -1
  72. package/types/uniq.d.ts +1 -1
  73. package/types/xor.d.ts +1 -1
  74. package/es/internals/sameValue.js +0 -10
  75. package/lib/internals/sameValue.js +0 -12
  76. package/types/internals/sameValue.d.ts +0 -12
package/es/eq.js CHANGED
@@ -1,11 +1,9 @@
1
- import sameValue from './internals/sameValue.js';
2
-
3
1
  function eq(value, other, strictCheck) {
4
2
  if (strictCheck === void 0) { strictCheck = false; }
5
- if (strictCheck) {
6
- return sameValue(value, other);
3
+ if (value === other) {
4
+ return strictCheck ? value !== 0 || 1 / value === 1 / other : true;
7
5
  }
8
- return value === other || (value !== value && other !== other);
6
+ return value !== value && other !== other;
9
7
  }
10
8
 
11
9
  export { eq as default };
package/es/index.js CHANGED
@@ -23,35 +23,6 @@ export { default as negate } from './negate.js';
23
23
  export { default as once } from './once.js';
24
24
  export { default as partial } from './partial.js';
25
25
  export { default as throttle } from './throttle.js';
26
- export { default as ceil } from './ceil.js';
27
- export { default as floor } from './floor.js';
28
- export { default as max } from './max.js';
29
- export { default as min } from './min.js';
30
- export { default as round } from './round.js';
31
- export { default as clamp } from './clamp.js';
32
- export { default as inRange } from './inRange.js';
33
- export { default as random } from './random.js';
34
- export { default as randomInt } from './randomInt.js';
35
- export { default as allKeys } from './allKeys.js';
36
- export { default as allKeysIn } from './allKeysIn.js';
37
- export { default as keysIn } from './keysIn.js';
38
- export { default as merge } from './merge.js';
39
- export { default as omit } from './omit.js';
40
- export { default as omitBy } from './omitBy.js';
41
- export { default as pick } from './pick.js';
42
- export { default as pickBy } from './pickBy.js';
43
- export { default as camelCase } from './camelCase.js';
44
- export { default as capitalize } from './capitalize.js';
45
- export { default as escape } from './escape.js';
46
- export { default as escapeRegExp } from './escapeRegExp.js';
47
- export { default as kebabCase } from './kebabCase.js';
48
- export { default as lowerCase } from './lowerCase.js';
49
- export { default as lowerFirst } from './lowerFirst.js';
50
- export { default as snakeCase } from './snakeCase.js';
51
- export { default as unescape } from './unescape.js';
52
- export { default as upperCase } from './upperCase.js';
53
- export { default as upperFirst } from './upperFirst.js';
54
- export { default as words } from './words.js';
55
26
  export { default as isArguments } from './isArguments.js';
56
27
  export { default as isArray } from './isArray.js';
57
28
  export { default as isArrayBuffer } from './isArrayBuffer.js';
@@ -64,6 +35,7 @@ export { default as isDataView } from './isDataView.js';
64
35
  export { default as isDate } from './isDate.js';
65
36
  export { default as isElement } from './isElement.js';
66
37
  export { default as isEmpty } from './isEmpty.js';
38
+ export { default as isEqual } from './isEqual.js';
67
39
  export { default as isError } from './isError.js';
68
40
  export { default as isFinite } from './isFinite.js';
69
41
  export { default as isFunction } from './isFunction.js';
@@ -87,6 +59,35 @@ export { default as isTypedArray } from './isTypedArray.js';
87
59
  export { default as isUndefined } from './isUndefined.js';
88
60
  export { default as isWeakMap } from './isWeakMap.js';
89
61
  export { default as isWeakSet } from './isWeakSet.js';
62
+ export { default as ceil } from './ceil.js';
63
+ export { default as floor } from './floor.js';
64
+ export { default as max } from './max.js';
65
+ export { default as min } from './min.js';
66
+ export { default as round } from './round.js';
67
+ export { default as clamp } from './clamp.js';
68
+ export { default as inRange } from './inRange.js';
69
+ export { default as random } from './random.js';
70
+ export { default as randomInt } from './randomInt.js';
71
+ export { default as allKeys } from './allKeys.js';
72
+ export { default as allKeysIn } from './allKeysIn.js';
73
+ export { default as keysIn } from './keysIn.js';
74
+ export { default as merge } from './merge.js';
75
+ export { default as omit } from './omit.js';
76
+ export { default as omitBy } from './omitBy.js';
77
+ export { default as pick } from './pick.js';
78
+ export { default as pickBy } from './pickBy.js';
79
+ export { default as camelCase } from './camelCase.js';
80
+ export { default as capitalize } from './capitalize.js';
81
+ export { default as escape } from './escape.js';
82
+ export { default as escapeRegExp } from './escapeRegExp.js';
83
+ export { default as kebabCase } from './kebabCase.js';
84
+ export { default as lowerCase } from './lowerCase.js';
85
+ export { default as lowerFirst } from './lowerFirst.js';
86
+ export { default as snakeCase } from './snakeCase.js';
87
+ export { default as unescape } from './unescape.js';
88
+ export { default as upperCase } from './upperCase.js';
89
+ export { default as upperFirst } from './upperFirst.js';
90
+ export { default as words } from './words.js';
90
91
  export { default as castArray } from './castArray.js';
91
92
  export { default as conforms } from './conforms.js';
92
93
  export { default as conformsTo } from './conformsTo.js';
@@ -1,25 +1,42 @@
1
1
  import isSymbol from '../isSymbol.js';
2
+ import toString from '../toString.js';
2
3
 
3
4
  function compareAsc(value, other) {
4
- if (isSymbol(value) || isSymbol(other)) {
5
+ if (isSymbol(value) && isSymbol(other)) {
5
6
  return 0;
6
7
  }
7
- if (value > other) {
8
+ if (isSymbol(value)) {
8
9
  return 1;
9
10
  }
10
- else if (value < other) {
11
+ if (isSymbol(other)) {
12
+ return -1;
13
+ }
14
+ var valStr = toString(value);
15
+ var othStr = toString(other);
16
+ if (valStr > othStr) {
17
+ return 1;
18
+ }
19
+ if (valStr < othStr) {
11
20
  return -1;
12
21
  }
13
22
  return 0;
14
23
  }
15
24
  function compareDesc(value, other) {
16
- if (isSymbol(value) || isSymbol(other)) {
25
+ if (isSymbol(value) && isSymbol(other)) {
17
26
  return 0;
18
27
  }
19
- if (value > other) {
28
+ if (isSymbol(value)) {
29
+ return -1;
30
+ }
31
+ if (isSymbol(other)) {
32
+ return 1;
33
+ }
34
+ var valStr = toString(value);
35
+ var othStr = toString(other);
36
+ if (valStr > othStr) {
20
37
  return -1;
21
38
  }
22
- else if (value < other) {
39
+ if (valStr < othStr) {
23
40
  return 1;
24
41
  }
25
42
  return 0;
@@ -1,11 +1,11 @@
1
- import { dataViewExisted, objectToString, dataViewTag, mapExisted, mapTag, promiseExisted, promiseTag, setExisted, setTag, weakMapExisted, weakMapTag, objectTag, toSource, weakMapCtorString, setCtorString, promiseCtorString, mapCtorString, dataViewCtorString, hasOwnProperty } from './native.js';
1
+ import { dataViewExisted, objectToString, dataViewTag, mapExisted, mapTag, promiseExisted, promiseTag, setExisted, setTag, weakMapExisted, weakMapTag, objectTag, toSource, weakMapCtorString, setCtorString, promiseCtorString, mapCtorString, dataViewCtorString, symToStringTag, hasOwnProperty } from './native.js';
2
2
 
3
3
  function getRawTag(value) {
4
- var isOwn = hasOwnProperty.call(value, Symbol.toStringTag);
5
- var tag = value[Symbol.toStringTag];
4
+ var isOwn = hasOwnProperty.call(value, symToStringTag);
5
+ var tag = value[symToStringTag];
6
6
  var unmasked = false;
7
7
  try {
8
- value[Symbol.toStringTag] = undefined;
8
+ value[symToStringTag] = undefined;
9
9
  unmasked = true;
10
10
  }
11
11
  catch (e) {
@@ -13,18 +13,16 @@ function getRawTag(value) {
13
13
  var result = objectToString.call(value);
14
14
  if (unmasked) {
15
15
  if (isOwn) {
16
- value[Symbol.toStringTag] = tag;
16
+ value[symToStringTag] = tag;
17
17
  }
18
18
  else {
19
- delete value[Symbol.toStringTag];
19
+ delete value[symToStringTag];
20
20
  }
21
21
  }
22
22
  return result;
23
23
  }
24
24
  function _getTag(value) {
25
- return Symbol && Symbol.toStringTag && Symbol.toStringTag in Object(value)
26
- ? getRawTag(value)
27
- : objectToString.call(value);
25
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString.call(value);
28
26
  }
29
27
  var getTag = _getTag;
30
28
  if ((dataViewExisted && objectToString.call(new DataView(new ArrayBuffer(1))) !== dataViewTag) ||
@@ -1,4 +1,5 @@
1
1
  import isType from './isType.js';
2
+ import { arrayProto } from './native.js';
2
3
 
3
4
  var argType = 'Arguments';
4
5
  var supportedArgumentsType = isType((function () { return arguments; })(), argType);
@@ -7,8 +8,7 @@ var numberIsFinite = Number.isFinite;
7
8
  var numberIsInteger = Number.isInteger;
8
9
  var numberIsSafeInteger = Number.isSafeInteger;
9
10
  var objectGetOwnPropertySymbols = Object.getOwnPropertySymbols;
10
- var arrayAt = Array.prototype.at;
11
- var objectIs = Object.is;
12
- var VERSION = "1.2.1";
11
+ var arrayAt = arrayProto.at;
12
+ var VERSION = "1.3.0";
13
13
 
14
- export { FUNC_ERROR_TEXT, VERSION, argType, arrayAt, numberIsFinite, numberIsInteger, numberIsSafeInteger, objectGetOwnPropertySymbols, objectIs, supportedArgumentsType };
14
+ export { FUNC_ERROR_TEXT, VERSION, argType, arrayAt, numberIsFinite, numberIsInteger, numberIsSafeInteger, objectGetOwnPropertySymbols, supportedArgumentsType };
@@ -8,6 +8,12 @@ var hasOwnProperty = objectProto.hasOwnProperty;
8
8
  var propertyIsEnumerable = objectProto.propertyIsEnumerable;
9
9
  var functionToString = Function.prototype.toString;
10
10
  var objectCtorString = functionToString.call(Object);
11
+ var symbolProto = Symbol ? Symbol.prototype : undefined;
12
+ var symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
13
+ symbolProto ? symbolProto.toString : undefined;
14
+ var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
15
+ var arrayProto = Array.prototype;
16
+ var arrSlice = Array.prototype.slice;
11
17
  var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
12
18
  var MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;
13
19
  var MAX_ARRAY_LENGTH = 4294967295;
@@ -27,6 +33,16 @@ function toSource(func) {
27
33
  }
28
34
  return '';
29
35
  }
36
+ var numberTag = '[object Number]';
37
+ var booleanTag = '[object Boolean]';
38
+ var stringTag = '[object String]';
39
+ var dateTag = '[object Date]';
40
+ var regExpTag = '[object RegExp]';
41
+ var symbolTag = '[object Symbol]';
42
+ var errorTag = '[object Error]';
43
+ var arrayBufferTag = '[object ArrayBuffer]';
44
+ var argumentsTag = '[object Arguments]';
45
+ var arrayTag = '[object Array]';
30
46
  var objectTag = '[object Object]';
31
47
  var dataViewTag = '[object DataView]';
32
48
  var mapTag = '[object Map]';
@@ -45,4 +61,4 @@ var promiseCtorString = initSource(promiseExisted, toSource(Promise));
45
61
  var setCtorString = initSource(setExisted, toSource(Set));
46
62
  var weakMapCtorString = initSource(weakMapExisted, toSource(WeakMap));
47
63
 
48
- export { MAX_ARRAY_LENGTH, MAX_SAFE_INTEGER, MIN_SAFE_INTEGER, blobExisted, dataViewCtorString, dataViewExisted, dataViewTag, functionToString, hasOwnProperty, initSource, mapCtorString, mapExisted, mapTag, objectCtorString, objectProto, objectTag, objectToString, promiseCtorString, promiseExisted, promiseTag, propertyIsEnumerable, root, setCtorString, setExisted, setTag, toSource, weakMapCtorString, weakMapExisted, weakMapTag };
64
+ export { MAX_ARRAY_LENGTH, MAX_SAFE_INTEGER, MIN_SAFE_INTEGER, argumentsTag, arrSlice, arrayBufferTag, arrayProto, arrayTag, blobExisted, booleanTag, dataViewCtorString, dataViewExisted, dataViewTag, dateTag, errorTag, functionToString, hasOwnProperty, initSource, mapCtorString, mapExisted, mapTag, numberTag, objectCtorString, objectProto, objectTag, objectToString, promiseCtorString, promiseExisted, promiseTag, propertyIsEnumerable, regExpTag, root, setCtorString, setExisted, setTag, stringTag, symToStringTag, symbolProto, symbolTag, symbolValueOf, toSource, weakMapCtorString, weakMapExisted, weakMapTag };
package/es/isArguments.js CHANGED
@@ -7,9 +7,7 @@ function isArguments(value) {
7
7
  if (supportedArgumentsType) {
8
8
  return isObjectLike(value) && isType(value, argType);
9
9
  }
10
- return (isObjectLike(value) &&
11
- hasOwnProperty.call(value, 'callee') &&
12
- !propertyIsEnumerable.call(value, 'callee'));
10
+ return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
13
11
  }
14
12
 
15
13
  export { isArguments as default };
@@ -3,9 +3,7 @@ import { nodeIsArrayBuffer } from './internals/nodeUtil.js';
3
3
  import isObjectLike from './isObjectLike.js';
4
4
 
5
5
  function isArrayBuffer(value) {
6
- return nodeIsArrayBuffer
7
- ? nodeIsArrayBuffer(value)
8
- : isObjectLike(value) && isType(value, 'ArrayBuffer');
6
+ return nodeIsArrayBuffer ? nodeIsArrayBuffer(value) : isObjectLike(value) && isType(value, 'ArrayBuffer');
9
7
  }
10
8
 
11
9
  export { isArrayBuffer as default };
package/es/isEqual.js ADDED
@@ -0,0 +1,185 @@
1
+ import allKeys from './allKeys.js';
2
+ import eq from './eq.js';
3
+ import getTag from './internals/getTag.js';
4
+ import { arrayBufferTag, dataViewTag, errorTag, symbolTag, symbolValueOf, regExpTag, stringTag, dateTag, booleanTag, numberTag, objectTag, hasOwnProperty, argumentsTag, setTag, mapTag, arrayTag, arrSlice } from './internals/native.js';
5
+ import isBuffer from './isBuffer.js';
6
+ import isFunction from './isFunction.js';
7
+ import isNil from './isNil.js';
8
+ import isObjectLike from './isObjectLike.js';
9
+ import isTypedArray from './isTypedArray.js';
10
+ import orderBy from './orderBy.js';
11
+
12
+ function mapToArray(map) {
13
+ var result = [];
14
+ map.forEach(function (value, key) {
15
+ result.push([key, value]);
16
+ });
17
+ return orderBy(result, function (item) { return item[0]; });
18
+ }
19
+ function setToArray(set) {
20
+ var result = [];
21
+ set.forEach(function (value) {
22
+ result.push(value);
23
+ });
24
+ return orderBy(result);
25
+ }
26
+ function argToArray(arg) {
27
+ return arrSlice.call(arg);
28
+ }
29
+ function toBufferView(bufferSource) {
30
+ return new Uint8Array(bufferSource.buffer || bufferSource, bufferSource.byteOffset || 0, bufferSource.byteLength);
31
+ }
32
+ function isDomNode(obj) {
33
+ return isObjectLike(obj) && typeof obj.nodeType === 'number' && typeof obj.nodeName === 'string' && typeof obj.isEqualNode === 'function';
34
+ }
35
+ function isEqualDeep(value, other, customizer, strictCheck, valueStack, otherStack) {
36
+ if (eq(value, other, strictCheck)) {
37
+ return true;
38
+ }
39
+ var valType = typeof value;
40
+ var othType = typeof other;
41
+ if (strictCheck && valType !== othType) {
42
+ return false;
43
+ }
44
+ if (isNil(value) || isNil(other) || (valType !== 'object' && othType !== 'object')) {
45
+ return false;
46
+ }
47
+ var tag = getTag(value);
48
+ if (tag !== getTag(other)) {
49
+ return false;
50
+ }
51
+ var convert;
52
+ switch (tag) {
53
+ case numberTag:
54
+ return eq(+value, +other, strictCheck);
55
+ case booleanTag:
56
+ case dateTag:
57
+ return strictCheck ? +value === +other : eq(+value, +other);
58
+ case stringTag:
59
+ case regExpTag:
60
+ return '' + value === '' + other;
61
+ case symbolTag:
62
+ return symbolValueOf ? symbolValueOf.call(value) === symbolValueOf.call(other) : false;
63
+ case errorTag:
64
+ return value.name == other.name && value.message == other.message;
65
+ case dataViewTag:
66
+ case arrayBufferTag:
67
+ if (value.byteLength !== other.byteLength || (value.byteOffset && value.byteOffset !== other.byteOffset)) {
68
+ return false;
69
+ }
70
+ convert = toBufferView;
71
+ break;
72
+ case mapTag:
73
+ convert = mapToArray;
74
+ break;
75
+ case setTag:
76
+ convert = setToArray;
77
+ break;
78
+ case argumentsTag:
79
+ convert = argToArray;
80
+ break;
81
+ }
82
+ if (convert) {
83
+ return isEqualDeep(convert(value), convert(other), customizer, strictCheck, valueStack, otherStack);
84
+ }
85
+ if (isDomNode(value) && isDomNode(other)) {
86
+ return value.isEqualNode(other);
87
+ }
88
+ var areArrays = tag === arrayTag;
89
+ if (!areArrays && isTypedArray(value)) {
90
+ if (value.byteLength !== other.byteLength) {
91
+ return false;
92
+ }
93
+ if (value.buffer === other.buffer && value.byteOffset === other.byteOffset) {
94
+ return true;
95
+ }
96
+ areArrays = true;
97
+ }
98
+ if (isBuffer(value)) {
99
+ if (!isBuffer(other)) {
100
+ return false;
101
+ }
102
+ areArrays = true;
103
+ }
104
+ valueStack = valueStack || [];
105
+ otherStack = otherStack || [];
106
+ var length = valueStack.length;
107
+ while (length--) {
108
+ if (valueStack[length] === value) {
109
+ return otherStack[length] === other;
110
+ }
111
+ }
112
+ valueStack.push(value);
113
+ otherStack.push(other);
114
+ var result = true;
115
+ var hasCustomizer = typeof customizer === 'function';
116
+ if (areArrays) {
117
+ length = value.length;
118
+ if (length !== other.length) {
119
+ return false;
120
+ }
121
+ while (length--) {
122
+ if (hasCustomizer) {
123
+ var compared = customizer(value[length], other[length], length, value, other, valueStack, otherStack);
124
+ if (compared !== undefined) {
125
+ result = !!compared;
126
+ break;
127
+ }
128
+ }
129
+ if (!isEqualDeep(value[length], other[length], customizer, strictCheck, valueStack, otherStack)) {
130
+ result = false;
131
+ break;
132
+ }
133
+ }
134
+ }
135
+ else if (tag === objectTag) {
136
+ var keys = allKeys(value);
137
+ length = keys.length;
138
+ if (allKeys(other).length !== length) {
139
+ return false;
140
+ }
141
+ var skipCtor = false;
142
+ while (length--) {
143
+ var key = keys[length];
144
+ if (hasCustomizer) {
145
+ var compared = customizer(value[key], other[key], key, value, other, valueStack, otherStack);
146
+ if (compared !== undefined) {
147
+ result = !!compared;
148
+ break;
149
+ }
150
+ }
151
+ if (!(hasOwnProperty.call(other, key) && isEqualDeep(value[key], other[key], customizer, strictCheck, valueStack, otherStack))) {
152
+ result = false;
153
+ break;
154
+ }
155
+ if (!skipCtor && key === 'constructor') {
156
+ skipCtor = true;
157
+ }
158
+ }
159
+ if (result && !skipCtor) {
160
+ var valCtor = value.constructor;
161
+ var othCtor = other.constructor;
162
+ if (valCtor !== othCtor && !(isFunction(valCtor) && valCtor instanceof valCtor && isFunction(othCtor) && othCtor instanceof othCtor) && 'constructor' in value && 'constructor' in other) {
163
+ result = false;
164
+ }
165
+ }
166
+ }
167
+ else {
168
+ result = false;
169
+ }
170
+ valueStack.pop();
171
+ otherStack.pop();
172
+ return result;
173
+ }
174
+ function isEqual(value, other, customizer, strictCheck) {
175
+ if (strictCheck === void 0) { strictCheck = false; }
176
+ if (typeof customizer === 'function') {
177
+ var result = customizer(value, other);
178
+ if (result !== undefined) {
179
+ return !!result;
180
+ }
181
+ }
182
+ return isEqualDeep(value, other, customizer, strictCheck);
183
+ }
184
+
185
+ export { isEqual as default };
@@ -3,9 +3,7 @@ import { numberIsSafeInteger } from './internals/helpers.js';
3
3
  import isInteger from './isInteger.js';
4
4
 
5
5
  function isSafeInteger(value) {
6
- return numberIsSafeInteger
7
- ? numberIsSafeInteger(value)
8
- : isInteger(value) && Math.abs(value) <= MAX_SAFE_INTEGER;
6
+ return numberIsSafeInteger ? numberIsSafeInteger(value) : isInteger(value) && Math.abs(value) <= MAX_SAFE_INTEGER;
9
7
  }
10
8
 
11
9
  export { isSafeInteger as default };
@@ -7,21 +7,7 @@ function isTypedArray(value) {
7
7
  if (nodeIsTypedArray) {
8
8
  return nodeIsTypedArray(value);
9
9
  }
10
- return (isObjectLike(value) &&
11
- isLength(value.length) &&
12
- isType(value, [
13
- 'Float32Array',
14
- 'Float64Array',
15
- 'Int8Array',
16
- 'Int16Array',
17
- 'Int32Array',
18
- 'Uint8Array',
19
- 'Uint8ClampedArray',
20
- 'Uint16Array',
21
- 'Uint32Array',
22
- 'BigInt64Array',
23
- 'BigUint64Array'
24
- ]));
10
+ return isObjectLike(value) && isLength(value.length) && isType(value, ['Float32Array', 'Float64Array', 'Int8Array', 'Int16Array', 'Int32Array', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'BigInt64Array', 'BigUint64Array']);
25
11
  }
26
12
 
27
13
  export { isTypedArray as default };
package/lib/eq.js CHANGED
@@ -1,13 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var sameValue = require('./internals/sameValue.js');
4
-
5
3
  function eq(value, other, strictCheck) {
6
4
  if (strictCheck === void 0) { strictCheck = false; }
7
- if (strictCheck) {
8
- return sameValue(value, other);
5
+ if (value === other) {
6
+ return strictCheck ? value !== 0 || 1 / value === 1 / other : true;
9
7
  }
10
- return value === other || (value !== value && other !== other);
8
+ return value !== value && other !== other;
11
9
  }
12
10
 
13
11
  module.exports = eq;
package/lib/index.js CHANGED
@@ -25,35 +25,6 @@ var negate = require('./negate.js');
25
25
  var once = require('./once.js');
26
26
  var partial = require('./partial.js');
27
27
  var throttle = require('./throttle.js');
28
- var ceil = require('./ceil.js');
29
- var floor = require('./floor.js');
30
- var max = require('./max.js');
31
- var min = require('./min.js');
32
- var round = require('./round.js');
33
- var clamp = require('./clamp.js');
34
- var inRange = require('./inRange.js');
35
- var random = require('./random.js');
36
- var randomInt = require('./randomInt.js');
37
- var allKeys = require('./allKeys.js');
38
- var allKeysIn = require('./allKeysIn.js');
39
- var keysIn = require('./keysIn.js');
40
- var merge = require('./merge.js');
41
- var omit = require('./omit.js');
42
- var omitBy = require('./omitBy.js');
43
- var pick = require('./pick.js');
44
- var pickBy = require('./pickBy.js');
45
- var camelCase = require('./camelCase.js');
46
- var capitalize = require('./capitalize.js');
47
- var escape = require('./escape.js');
48
- var escapeRegExp = require('./escapeRegExp.js');
49
- var kebabCase = require('./kebabCase.js');
50
- var lowerCase = require('./lowerCase.js');
51
- var lowerFirst = require('./lowerFirst.js');
52
- var snakeCase = require('./snakeCase.js');
53
- var unescape = require('./unescape.js');
54
- var upperCase = require('./upperCase.js');
55
- var upperFirst = require('./upperFirst.js');
56
- var words = require('./words.js');
57
28
  var isArguments = require('./isArguments.js');
58
29
  var isArray = require('./isArray.js');
59
30
  var isArrayBuffer = require('./isArrayBuffer.js');
@@ -66,6 +37,7 @@ var isDataView = require('./isDataView.js');
66
37
  var isDate = require('./isDate.js');
67
38
  var isElement = require('./isElement.js');
68
39
  var isEmpty = require('./isEmpty.js');
40
+ var isEqual = require('./isEqual.js');
69
41
  var isError = require('./isError.js');
70
42
  var isFinite = require('./isFinite.js');
71
43
  var isFunction = require('./isFunction.js');
@@ -89,6 +61,35 @@ var isTypedArray = require('./isTypedArray.js');
89
61
  var isUndefined = require('./isUndefined.js');
90
62
  var isWeakMap = require('./isWeakMap.js');
91
63
  var isWeakSet = require('./isWeakSet.js');
64
+ var ceil = require('./ceil.js');
65
+ var floor = require('./floor.js');
66
+ var max = require('./max.js');
67
+ var min = require('./min.js');
68
+ var round = require('./round.js');
69
+ var clamp = require('./clamp.js');
70
+ var inRange = require('./inRange.js');
71
+ var random = require('./random.js');
72
+ var randomInt = require('./randomInt.js');
73
+ var allKeys = require('./allKeys.js');
74
+ var allKeysIn = require('./allKeysIn.js');
75
+ var keysIn = require('./keysIn.js');
76
+ var merge = require('./merge.js');
77
+ var omit = require('./omit.js');
78
+ var omitBy = require('./omitBy.js');
79
+ var pick = require('./pick.js');
80
+ var pickBy = require('./pickBy.js');
81
+ var camelCase = require('./camelCase.js');
82
+ var capitalize = require('./capitalize.js');
83
+ var escape = require('./escape.js');
84
+ var escapeRegExp = require('./escapeRegExp.js');
85
+ var kebabCase = require('./kebabCase.js');
86
+ var lowerCase = require('./lowerCase.js');
87
+ var lowerFirst = require('./lowerFirst.js');
88
+ var snakeCase = require('./snakeCase.js');
89
+ var unescape = require('./unescape.js');
90
+ var upperCase = require('./upperCase.js');
91
+ var upperFirst = require('./upperFirst.js');
92
+ var words = require('./words.js');
92
93
  var castArray = require('./castArray.js');
93
94
  var conforms = require('./conforms.js');
94
95
  var conformsTo = require('./conformsTo.js');
@@ -141,35 +142,6 @@ exports.negate = negate;
141
142
  exports.once = once;
142
143
  exports.partial = partial;
143
144
  exports.throttle = throttle;
144
- exports.ceil = ceil;
145
- exports.floor = floor;
146
- exports.max = max;
147
- exports.min = min;
148
- exports.round = round;
149
- exports.clamp = clamp;
150
- exports.inRange = inRange;
151
- exports.random = random;
152
- exports.randomInt = randomInt;
153
- exports.allKeys = allKeys;
154
- exports.allKeysIn = allKeysIn;
155
- exports.keysIn = keysIn;
156
- exports.merge = merge;
157
- exports.omit = omit;
158
- exports.omitBy = omitBy;
159
- exports.pick = pick;
160
- exports.pickBy = pickBy;
161
- exports.camelCase = camelCase;
162
- exports.capitalize = capitalize;
163
- exports.escape = escape;
164
- exports.escapeRegExp = escapeRegExp;
165
- exports.kebabCase = kebabCase;
166
- exports.lowerCase = lowerCase;
167
- exports.lowerFirst = lowerFirst;
168
- exports.snakeCase = snakeCase;
169
- exports.unescape = unescape;
170
- exports.upperCase = upperCase;
171
- exports.upperFirst = upperFirst;
172
- exports.words = words;
173
145
  exports.isArguments = isArguments;
174
146
  exports.isArray = isArray;
175
147
  exports.isArrayBuffer = isArrayBuffer;
@@ -182,6 +154,7 @@ exports.isDataView = isDataView;
182
154
  exports.isDate = isDate;
183
155
  exports.isElement = isElement;
184
156
  exports.isEmpty = isEmpty;
157
+ exports.isEqual = isEqual;
185
158
  exports.isError = isError;
186
159
  exports.isFinite = isFinite;
187
160
  exports.isFunction = isFunction;
@@ -205,6 +178,35 @@ exports.isTypedArray = isTypedArray;
205
178
  exports.isUndefined = isUndefined;
206
179
  exports.isWeakMap = isWeakMap;
207
180
  exports.isWeakSet = isWeakSet;
181
+ exports.ceil = ceil;
182
+ exports.floor = floor;
183
+ exports.max = max;
184
+ exports.min = min;
185
+ exports.round = round;
186
+ exports.clamp = clamp;
187
+ exports.inRange = inRange;
188
+ exports.random = random;
189
+ exports.randomInt = randomInt;
190
+ exports.allKeys = allKeys;
191
+ exports.allKeysIn = allKeysIn;
192
+ exports.keysIn = keysIn;
193
+ exports.merge = merge;
194
+ exports.omit = omit;
195
+ exports.omitBy = omitBy;
196
+ exports.pick = pick;
197
+ exports.pickBy = pickBy;
198
+ exports.camelCase = camelCase;
199
+ exports.capitalize = capitalize;
200
+ exports.escape = escape;
201
+ exports.escapeRegExp = escapeRegExp;
202
+ exports.kebabCase = kebabCase;
203
+ exports.lowerCase = lowerCase;
204
+ exports.lowerFirst = lowerFirst;
205
+ exports.snakeCase = snakeCase;
206
+ exports.unescape = unescape;
207
+ exports.upperCase = upperCase;
208
+ exports.upperFirst = upperFirst;
209
+ exports.words = words;
208
210
  exports.castArray = castArray;
209
211
  exports.conforms = conforms;
210
212
  exports.conformsTo = conformsTo;