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
@@ -1,27 +1,44 @@
1
1
  'use strict';
2
2
 
3
3
  var isSymbol = require('../isSymbol.js');
4
+ var toString = require('../toString.js');
4
5
 
5
6
  function compareAsc(value, other) {
6
- if (isSymbol(value) || isSymbol(other)) {
7
+ if (isSymbol(value) && isSymbol(other)) {
7
8
  return 0;
8
9
  }
9
- if (value > other) {
10
+ if (isSymbol(value)) {
10
11
  return 1;
11
12
  }
12
- else if (value < other) {
13
+ if (isSymbol(other)) {
14
+ return -1;
15
+ }
16
+ var valStr = toString(value);
17
+ var othStr = toString(other);
18
+ if (valStr > othStr) {
19
+ return 1;
20
+ }
21
+ if (valStr < othStr) {
13
22
  return -1;
14
23
  }
15
24
  return 0;
16
25
  }
17
26
  function compareDesc(value, other) {
18
- if (isSymbol(value) || isSymbol(other)) {
27
+ if (isSymbol(value) && isSymbol(other)) {
19
28
  return 0;
20
29
  }
21
- if (value > other) {
30
+ if (isSymbol(value)) {
31
+ return -1;
32
+ }
33
+ if (isSymbol(other)) {
34
+ return 1;
35
+ }
36
+ var valStr = toString(value);
37
+ var othStr = toString(other);
38
+ if (valStr > othStr) {
22
39
  return -1;
23
40
  }
24
- else if (value < other) {
41
+ if (valStr < othStr) {
25
42
  return 1;
26
43
  }
27
44
  return 0;
@@ -3,11 +3,11 @@
3
3
  var native = require('./native.js');
4
4
 
5
5
  function getRawTag(value) {
6
- var isOwn = native.hasOwnProperty.call(value, Symbol.toStringTag);
7
- var tag = value[Symbol.toStringTag];
6
+ var isOwn = native.hasOwnProperty.call(value, native.symToStringTag);
7
+ var tag = value[native.symToStringTag];
8
8
  var unmasked = false;
9
9
  try {
10
- value[Symbol.toStringTag] = undefined;
10
+ value[native.symToStringTag] = undefined;
11
11
  unmasked = true;
12
12
  }
13
13
  catch (e) {
@@ -15,18 +15,16 @@ function getRawTag(value) {
15
15
  var result = native.objectToString.call(value);
16
16
  if (unmasked) {
17
17
  if (isOwn) {
18
- value[Symbol.toStringTag] = tag;
18
+ value[native.symToStringTag] = tag;
19
19
  }
20
20
  else {
21
- delete value[Symbol.toStringTag];
21
+ delete value[native.symToStringTag];
22
22
  }
23
23
  }
24
24
  return result;
25
25
  }
26
26
  function _getTag(value) {
27
- return Symbol && Symbol.toStringTag && Symbol.toStringTag in Object(value)
28
- ? getRawTag(value)
29
- : native.objectToString.call(value);
27
+ return native.symToStringTag && native.symToStringTag in Object(value) ? getRawTag(value) : native.objectToString.call(value);
30
28
  }
31
29
  var getTag = _getTag;
32
30
  if ((native.dataViewExisted && native.objectToString.call(new DataView(new ArrayBuffer(1))) !== native.dataViewTag) ||
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var isType = require('./isType.js');
4
+ var native = require('./native.js');
4
5
 
5
6
  exports.argType = 'Arguments';
6
7
  exports.supportedArgumentsType = isType((function () { return arguments; })(), exports.argType);
@@ -9,6 +10,5 @@ exports.numberIsFinite = Number.isFinite;
9
10
  exports.numberIsInteger = Number.isInteger;
10
11
  exports.numberIsSafeInteger = Number.isSafeInteger;
11
12
  exports.objectGetOwnPropertySymbols = Object.getOwnPropertySymbols;
12
- exports.arrayAt = Array.prototype.at;
13
- exports.objectIs = Object.is;
14
- exports.VERSION = "1.2.1";
13
+ exports.arrayAt = native.arrayProto.at;
14
+ exports.VERSION = "1.3.0";
@@ -10,6 +10,12 @@ exports.hasOwnProperty = exports.objectProto.hasOwnProperty;
10
10
  exports.propertyIsEnumerable = exports.objectProto.propertyIsEnumerable;
11
11
  exports.functionToString = Function.prototype.toString;
12
12
  exports.objectCtorString = exports.functionToString.call(Object);
13
+ exports.symbolProto = Symbol ? Symbol.prototype : undefined;
14
+ exports.symbolValueOf = exports.symbolProto ? exports.symbolProto.valueOf : undefined;
15
+ exports.symbolProto ? exports.symbolProto.toString : undefined;
16
+ exports.symToStringTag = Symbol ? Symbol.toStringTag : undefined;
17
+ exports.arrayProto = Array.prototype;
18
+ exports.arrSlice = Array.prototype.slice;
13
19
  exports.MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
14
20
  exports.MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;
15
21
  exports.MAX_ARRAY_LENGTH = 4294967295;
@@ -29,6 +35,16 @@ function toSource(func) {
29
35
  }
30
36
  return '';
31
37
  }
38
+ exports.numberTag = '[object Number]';
39
+ exports.booleanTag = '[object Boolean]';
40
+ exports.stringTag = '[object String]';
41
+ exports.dateTag = '[object Date]';
42
+ exports.regExpTag = '[object RegExp]';
43
+ exports.symbolTag = '[object Symbol]';
44
+ exports.errorTag = '[object Error]';
45
+ exports.arrayBufferTag = '[object ArrayBuffer]';
46
+ exports.argumentsTag = '[object Arguments]';
47
+ exports.arrayTag = '[object Array]';
32
48
  exports.objectTag = '[object Object]';
33
49
  exports.dataViewTag = '[object DataView]';
34
50
  exports.mapTag = '[object Map]';
@@ -9,9 +9,7 @@ function isArguments(value) {
9
9
  if (helpers.supportedArgumentsType) {
10
10
  return isObjectLike(value) && isType(value, helpers.argType);
11
11
  }
12
- return (isObjectLike(value) &&
13
- native.hasOwnProperty.call(value, 'callee') &&
14
- !native.propertyIsEnumerable.call(value, 'callee'));
12
+ return isObjectLike(value) && native.hasOwnProperty.call(value, 'callee') && !native.propertyIsEnumerable.call(value, 'callee');
15
13
  }
16
14
 
17
15
  module.exports = isArguments;
@@ -5,9 +5,7 @@ var nodeUtil = require('./internals/nodeUtil.js');
5
5
  var isObjectLike = require('./isObjectLike.js');
6
6
 
7
7
  function isArrayBuffer(value) {
8
- return nodeUtil.nodeIsArrayBuffer
9
- ? nodeUtil.nodeIsArrayBuffer(value)
10
- : isObjectLike(value) && isType(value, 'ArrayBuffer');
8
+ return nodeUtil.nodeIsArrayBuffer ? nodeUtil.nodeIsArrayBuffer(value) : isObjectLike(value) && isType(value, 'ArrayBuffer');
11
9
  }
12
10
 
13
11
  module.exports = isArrayBuffer;
package/lib/isEqual.js ADDED
@@ -0,0 +1,187 @@
1
+ 'use strict';
2
+
3
+ var allKeys = require('./allKeys.js');
4
+ var eq = require('./eq.js');
5
+ var getTag = require('./internals/getTag.js');
6
+ var native = require('./internals/native.js');
7
+ var isBuffer = require('./isBuffer.js');
8
+ var isFunction = require('./isFunction.js');
9
+ var isNil = require('./isNil.js');
10
+ var isObjectLike = require('./isObjectLike.js');
11
+ var isTypedArray = require('./isTypedArray.js');
12
+ var orderBy = require('./orderBy.js');
13
+
14
+ function mapToArray(map) {
15
+ var result = [];
16
+ map.forEach(function (value, key) {
17
+ result.push([key, value]);
18
+ });
19
+ return orderBy(result, function (item) { return item[0]; });
20
+ }
21
+ function setToArray(set) {
22
+ var result = [];
23
+ set.forEach(function (value) {
24
+ result.push(value);
25
+ });
26
+ return orderBy(result);
27
+ }
28
+ function argToArray(arg) {
29
+ return native.arrSlice.call(arg);
30
+ }
31
+ function toBufferView(bufferSource) {
32
+ return new Uint8Array(bufferSource.buffer || bufferSource, bufferSource.byteOffset || 0, bufferSource.byteLength);
33
+ }
34
+ function isDomNode(obj) {
35
+ return isObjectLike(obj) && typeof obj.nodeType === 'number' && typeof obj.nodeName === 'string' && typeof obj.isEqualNode === 'function';
36
+ }
37
+ function isEqualDeep(value, other, customizer, strictCheck, valueStack, otherStack) {
38
+ if (eq(value, other, strictCheck)) {
39
+ return true;
40
+ }
41
+ var valType = typeof value;
42
+ var othType = typeof other;
43
+ if (strictCheck && valType !== othType) {
44
+ return false;
45
+ }
46
+ if (isNil(value) || isNil(other) || (valType !== 'object' && othType !== 'object')) {
47
+ return false;
48
+ }
49
+ var tag = getTag(value);
50
+ if (tag !== getTag(other)) {
51
+ return false;
52
+ }
53
+ var convert;
54
+ switch (tag) {
55
+ case native.numberTag:
56
+ return eq(+value, +other, strictCheck);
57
+ case native.booleanTag:
58
+ case native.dateTag:
59
+ return strictCheck ? +value === +other : eq(+value, +other);
60
+ case native.stringTag:
61
+ case native.regExpTag:
62
+ return '' + value === '' + other;
63
+ case native.symbolTag:
64
+ return native.symbolValueOf ? native.symbolValueOf.call(value) === native.symbolValueOf.call(other) : false;
65
+ case native.errorTag:
66
+ return value.name == other.name && value.message == other.message;
67
+ case native.dataViewTag:
68
+ case native.arrayBufferTag:
69
+ if (value.byteLength !== other.byteLength || (value.byteOffset && value.byteOffset !== other.byteOffset)) {
70
+ return false;
71
+ }
72
+ convert = toBufferView;
73
+ break;
74
+ case native.mapTag:
75
+ convert = mapToArray;
76
+ break;
77
+ case native.setTag:
78
+ convert = setToArray;
79
+ break;
80
+ case native.argumentsTag:
81
+ convert = argToArray;
82
+ break;
83
+ }
84
+ if (convert) {
85
+ return isEqualDeep(convert(value), convert(other), customizer, strictCheck, valueStack, otherStack);
86
+ }
87
+ if (isDomNode(value) && isDomNode(other)) {
88
+ return value.isEqualNode(other);
89
+ }
90
+ var areArrays = tag === native.arrayTag;
91
+ if (!areArrays && isTypedArray(value)) {
92
+ if (value.byteLength !== other.byteLength) {
93
+ return false;
94
+ }
95
+ if (value.buffer === other.buffer && value.byteOffset === other.byteOffset) {
96
+ return true;
97
+ }
98
+ areArrays = true;
99
+ }
100
+ if (isBuffer(value)) {
101
+ if (!isBuffer(other)) {
102
+ return false;
103
+ }
104
+ areArrays = true;
105
+ }
106
+ valueStack = valueStack || [];
107
+ otherStack = otherStack || [];
108
+ var length = valueStack.length;
109
+ while (length--) {
110
+ if (valueStack[length] === value) {
111
+ return otherStack[length] === other;
112
+ }
113
+ }
114
+ valueStack.push(value);
115
+ otherStack.push(other);
116
+ var result = true;
117
+ var hasCustomizer = typeof customizer === 'function';
118
+ if (areArrays) {
119
+ length = value.length;
120
+ if (length !== other.length) {
121
+ return false;
122
+ }
123
+ while (length--) {
124
+ if (hasCustomizer) {
125
+ var compared = customizer(value[length], other[length], length, value, other, valueStack, otherStack);
126
+ if (compared !== undefined) {
127
+ result = !!compared;
128
+ break;
129
+ }
130
+ }
131
+ if (!isEqualDeep(value[length], other[length], customizer, strictCheck, valueStack, otherStack)) {
132
+ result = false;
133
+ break;
134
+ }
135
+ }
136
+ }
137
+ else if (tag === native.objectTag) {
138
+ var keys = allKeys(value);
139
+ length = keys.length;
140
+ if (allKeys(other).length !== length) {
141
+ return false;
142
+ }
143
+ var skipCtor = false;
144
+ while (length--) {
145
+ var key = keys[length];
146
+ if (hasCustomizer) {
147
+ var compared = customizer(value[key], other[key], key, value, other, valueStack, otherStack);
148
+ if (compared !== undefined) {
149
+ result = !!compared;
150
+ break;
151
+ }
152
+ }
153
+ if (!(native.hasOwnProperty.call(other, key) && isEqualDeep(value[key], other[key], customizer, strictCheck, valueStack, otherStack))) {
154
+ result = false;
155
+ break;
156
+ }
157
+ if (!skipCtor && key === 'constructor') {
158
+ skipCtor = true;
159
+ }
160
+ }
161
+ if (result && !skipCtor) {
162
+ var valCtor = value.constructor;
163
+ var othCtor = other.constructor;
164
+ if (valCtor !== othCtor && !(isFunction(valCtor) && valCtor instanceof valCtor && isFunction(othCtor) && othCtor instanceof othCtor) && 'constructor' in value && 'constructor' in other) {
165
+ result = false;
166
+ }
167
+ }
168
+ }
169
+ else {
170
+ result = false;
171
+ }
172
+ valueStack.pop();
173
+ otherStack.pop();
174
+ return result;
175
+ }
176
+ function isEqual(value, other, customizer, strictCheck) {
177
+ if (strictCheck === void 0) { strictCheck = false; }
178
+ if (typeof customizer === 'function') {
179
+ var result = customizer(value, other);
180
+ if (result !== undefined) {
181
+ return !!result;
182
+ }
183
+ }
184
+ return isEqualDeep(value, other, customizer, strictCheck);
185
+ }
186
+
187
+ module.exports = isEqual;
@@ -5,9 +5,7 @@ var helpers = require('./internals/helpers.js');
5
5
  var isInteger = require('./isInteger.js');
6
6
 
7
7
  function isSafeInteger(value) {
8
- return helpers.numberIsSafeInteger
9
- ? helpers.numberIsSafeInteger(value)
10
- : isInteger(value) && Math.abs(value) <= native.MAX_SAFE_INTEGER;
8
+ return helpers.numberIsSafeInteger ? helpers.numberIsSafeInteger(value) : isInteger(value) && Math.abs(value) <= native.MAX_SAFE_INTEGER;
11
9
  }
12
10
 
13
11
  module.exports = isSafeInteger;
@@ -9,21 +9,7 @@ function isTypedArray(value) {
9
9
  if (nodeUtil.nodeIsTypedArray) {
10
10
  return nodeUtil.nodeIsTypedArray(value);
11
11
  }
12
- return (isObjectLike(value) &&
13
- isLength(value.length) &&
14
- isType(value, [
15
- 'Float32Array',
16
- 'Float64Array',
17
- 'Int8Array',
18
- 'Int16Array',
19
- 'Int32Array',
20
- 'Uint8Array',
21
- 'Uint8ClampedArray',
22
- 'Uint16Array',
23
- 'Uint32Array',
24
- 'BigInt64Array',
25
- 'BigUint64Array'
26
- ]));
12
+ return isObjectLike(value) && isLength(value.length) && isType(value, ['Float32Array', 'Float64Array', 'Int8Array', 'Int16Array', 'Int32Array', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'BigInt64Array', 'BigUint64Array']);
27
13
  }
28
14
 
29
15
  module.exports = isTypedArray;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ut2",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "author": "caijf",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -11,7 +11,7 @@
11
11
  * @param {Array} array 要检查的数组。
12
12
  * @param {Array} values 排除的值。
13
13
  * @param {Function | string} [iteratee] 迭代函数,调用每个元素。
14
- * @param {boolean} [strictCheck=false] 严格比较,区分 `+0` `-0`。
14
+ * @param {boolean} [strictCheck=false] 严格比较,区分 `0` `-0`,默认 `false` 。
15
15
  * @returns {Array} 过滤值后的新数组。
16
16
  * @example
17
17
  *
package/types/eq.d.ts CHANGED
@@ -9,11 +9,11 @@
9
9
  * @see {@link https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Equality_comparisons_and_sameness | JavaScript 中的相等性判断}
10
10
  * @param {*} value 要比较的值。
11
11
  * @param {*} other 另一个要比较的值。
12
- * @param {boolean} [strictCheck=false] 严格比较,区分 `+0` `-0`。
12
+ * @param {boolean} [strictCheck=false] 严格比较,区分 `0` `-0`,默认 `false` 。
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
  *
package/types/index.d.ts CHANGED
@@ -41,6 +41,48 @@ export { default as negate } from './negate';
41
41
  export { default as once } from './once';
42
42
  export { default as partial } from './partial';
43
43
  export { default as throttle } from './throttle';
44
+ /**
45
+ * 语言
46
+ *
47
+ * @module Language
48
+ * @since 1.0.0
49
+ */
50
+ export { default as isArguments } from './isArguments';
51
+ export { default as isArray } from './isArray';
52
+ export { default as isArrayBuffer } from './isArrayBuffer';
53
+ export { default as isArrayLike } from './isArrayLike';
54
+ export { default as isArrayLikeObject } from './isArrayLikeObject';
55
+ export { default as isBlob } from './isBlob';
56
+ export { default as isBoolean } from './isBoolean';
57
+ export { default as isBuffer } from './isBuffer';
58
+ export { default as isDataView } from './isDataView';
59
+ export { default as isDate } from './isDate';
60
+ export { default as isElement } from './isElement';
61
+ export { default as isEmpty } from './isEmpty';
62
+ export { default as isEqual } from './isEqual';
63
+ export { default as isError } from './isError';
64
+ export { default as isFinite } from './isFinite';
65
+ export { default as isFunction } from './isFunction';
66
+ export { default as isInteger } from './isInteger';
67
+ export { default as isLength } from './isLength';
68
+ export { default as isMap } from './isMap';
69
+ export { default as isNaN } from './isNaN';
70
+ export { default as isNil } from './isNil';
71
+ export { default as isNull } from './isNull';
72
+ export { default as isNumber } from './isNumber';
73
+ export { default as isObject } from './isObject';
74
+ export { default as isObjectLike } from './isObjectLike';
75
+ export { default as isPlainObject } from './isPlainObject';
76
+ export { default as isPromiseLike } from './isPromiseLike';
77
+ export { default as isRegExp } from './isRegExp';
78
+ export { default as isSafeInteger } from './isSafeInteger';
79
+ export { default as isSet } from './isSet';
80
+ export { default as isString } from './isString';
81
+ export { default as isSymbol } from './isSymbol';
82
+ export { default as isTypedArray } from './isTypedArray';
83
+ export { default as isUndefined } from './isUndefined';
84
+ export { default as isWeakMap } from './isWeakMap';
85
+ export { default as isWeakSet } from './isWeakSet';
44
86
  /**
45
87
  * 数学
46
88
  *
@@ -94,47 +136,6 @@ export { default as unescape } from './unescape';
94
136
  export { default as upperCase } from './upperCase';
95
137
  export { default as upperFirst } from './upperFirst';
96
138
  export { default as words } from './words';
97
- /**
98
- * 类型检测
99
- *
100
- * @module Type
101
- * @since 1.0.0
102
- */
103
- export { default as isArguments } from './isArguments';
104
- export { default as isArray } from './isArray';
105
- export { default as isArrayBuffer } from './isArrayBuffer';
106
- export { default as isArrayLike } from './isArrayLike';
107
- export { default as isArrayLikeObject } from './isArrayLikeObject';
108
- export { default as isBlob } from './isBlob';
109
- export { default as isBoolean } from './isBoolean';
110
- export { default as isBuffer } from './isBuffer';
111
- export { default as isDataView } from './isDataView';
112
- export { default as isDate } from './isDate';
113
- export { default as isElement } from './isElement';
114
- export { default as isEmpty } from './isEmpty';
115
- export { default as isError } from './isError';
116
- export { default as isFinite } from './isFinite';
117
- export { default as isFunction } from './isFunction';
118
- export { default as isInteger } from './isInteger';
119
- export { default as isLength } from './isLength';
120
- export { default as isMap } from './isMap';
121
- export { default as isNaN } from './isNaN';
122
- export { default as isNil } from './isNil';
123
- export { default as isNull } from './isNull';
124
- export { default as isNumber } from './isNumber';
125
- export { default as isObject } from './isObject';
126
- export { default as isObjectLike } from './isObjectLike';
127
- export { default as isPlainObject } from './isPlainObject';
128
- export { default as isPromiseLike } from './isPromiseLike';
129
- export { default as isRegExp } from './isRegExp';
130
- export { default as isSafeInteger } from './isSafeInteger';
131
- export { default as isSet } from './isSet';
132
- export { default as isString } from './isString';
133
- export { default as isSymbol } from './isSymbol';
134
- export { default as isTypedArray } from './isTypedArray';
135
- export { default as isUndefined } from './isUndefined';
136
- export { default as isWeakMap } from './isWeakMap';
137
- export { default as isWeakSet } from './isWeakSet';
138
139
  /**
139
140
  * 工具
140
141
  *
@@ -6,7 +6,6 @@ export declare const numberIsInteger: (number: unknown) => boolean;
6
6
  export declare const numberIsSafeInteger: (number: unknown) => boolean;
7
7
  export declare const objectGetOwnPropertySymbols: (o: any) => symbol[];
8
8
  export declare const arrayAt: (index: number) => any;
9
- export declare const objectIs: (value1: any, value2: any) => boolean;
10
9
  /**
11
10
  * ut2 版本号。
12
11
  *
@@ -5,6 +5,12 @@ export declare const hasOwnProperty: (v: PropertyKey) => boolean;
5
5
  export declare const propertyIsEnumerable: (v: PropertyKey) => boolean;
6
6
  export declare const functionToString: () => string;
7
7
  export declare const objectCtorString: string;
8
+ export declare const symbolProto: Symbol | undefined;
9
+ export declare const symbolValueOf: (() => symbol) | undefined;
10
+ export declare const symbolToString: (() => string) | undefined;
11
+ export declare const symToStringTag: typeof Symbol.toStringTag | undefined;
12
+ export declare const arrayProto: any[];
13
+ export declare const arrSlice: (start?: number | undefined, end?: number | undefined) => any[];
8
14
  /**
9
15
  * 最大安全整数。
10
16
  *
@@ -31,6 +37,16 @@ export declare const MIN_SAFE_INTEGER: number;
31
37
  export declare const MAX_ARRAY_LENGTH = 4294967295;
32
38
  export declare const blobExisted: boolean;
33
39
  export declare function toSource(func: any): string;
40
+ export declare const numberTag = "[object Number]";
41
+ export declare const booleanTag = "[object Boolean]";
42
+ export declare const stringTag = "[object String]";
43
+ export declare const dateTag = "[object Date]";
44
+ export declare const regExpTag = "[object RegExp]";
45
+ export declare const symbolTag = "[object Symbol]";
46
+ export declare const errorTag = "[object Error]";
47
+ export declare const arrayBufferTag = "[object ArrayBuffer]";
48
+ export declare const argumentsTag = "[object Arguments]";
49
+ export declare const arrayTag = "[object Array]";
34
50
  export declare const objectTag = "[object Object]";
35
51
  export declare const dataViewTag = "[object DataView]";
36
52
  export declare const mapTag = "[object Map]";
@@ -11,7 +11,7 @@
11
11
  * @param {Array} array 要检查的数组。
12
12
  * @param {Array} other 另一个要检查的数组。
13
13
  * @param {Function | string} [iteratee] 迭代函数,调用每个元素。
14
- * @param {boolean} [strictCheck=false] 严格比较,区分 `+0` `-0`。
14
+ * @param {boolean} [strictCheck=false] 严格比较,区分 `0` `-0`,默认 `false` 。
15
15
  * @returns {Array} 包含所有传入数组交集元素的新数组。
16
16
  * @example
17
17
  *
@@ -2,7 +2,7 @@
2
2
  * 检查值是否为 `arguments` 对象。
3
3
  *
4
4
  * @static
5
- * @alias module:Type.isArguments
5
+ * @alias module:Language.isArguments
6
6
  * @since 1.0.0
7
7
  * @param {*} value 要检查的值。
8
8
  * @returns {boolean} 如果值为 `arguments` 对象,返回 `true` ,否则返回 `false` 。
@@ -2,7 +2,7 @@
2
2
  * 检查值是否为 `Array` 对象。
3
3
  *
4
4
  * @static
5
- * @alias module:Type.isArray
5
+ * @alias module:Language.isArray
6
6
  * @since 1.0.0
7
7
  * @param {*} value 要检查的值
8
8
  * @returns {boolean} 如果值为 `Array` 对象,返回 `true` ,否则返回 `false` 。
@@ -2,7 +2,7 @@
2
2
  * 检查值是否为 `ArrayBuffer` 对象。
3
3
  *
4
4
  * @static
5
- * @alias module:Type.isArrayBuffer
5
+ * @alias module:Language.isArrayBuffer
6
6
  * @since 1.0.0
7
7
  * @param {*} value 要检查的值。
8
8
  * @returns {boolean} 如果值为 `ArrayBuffer` 对象,返回 `true` ,否则返回 `false` 。
@@ -4,7 +4,7 @@
4
4
  * 如果一个值不是函数并且其 `value.length` 是大于或等于 `0` 且小于或等于 `Number.MAX_SAFE_INTEGER` 的整数,则该值被视为类数组。
5
5
  *
6
6
  * @static
7
- * @alias module:Type.isArrayLike
7
+ * @alias module:Language.isArrayLike
8
8
  * @since 1.0.0
9
9
  * @param {*} value 要检查的值。
10
10
  * @returns {boolean} 如果值为类数组,返回 `true` ,否则返回 `false` 。
@@ -2,7 +2,7 @@
2
2
  * 检查值是否为类数组对象。
3
3
  *
4
4
  * @static
5
- * @alias module:Type.isArrayLikeObject
5
+ * @alias module:Language.isArrayLikeObject
6
6
  * @since 1.0.0
7
7
  * @param {*} value 要检查的值
8
8
  * @returns {boolean} 如果值为类数组对象,返回 `true` ,否则返回 `false` 。
package/types/isBlob.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * 浏览器环境的 `Blob` 或 `File` 对象,或其他继承自 `Blob` 的实例,都将返回 `true` 。
5
5
  *
6
6
  * @static
7
- * @alias module:Type.isBlob
7
+ * @alias module:Language.isBlob
8
8
  * @since 1.0.0
9
9
  * @see {@link https://developer.mozilla.org/zh-CN/docs/Web/API/Blob | Blob}
10
10
  * @see {@link https://developer.mozilla.org/zh-CN/docs/Web/API/File | File}
@@ -2,7 +2,7 @@
2
2
  * 检查值是否为布尔类型或对象。
3
3
  *
4
4
  * @static
5
- * @alias module:Type.isBoolean
5
+ * @alias module:Language.isBoolean
6
6
  * @since 1.0.0
7
7
  * @param {*} value 要检查的值。
8
8
  * @returns {boolean} 如果值为布尔类型或对象,返回 `true` 否则返回 `false` 。
@@ -5,7 +5,7 @@
5
5
  * 非 Node.js 环境,始终返回 `false` 。
6
6
  *
7
7
  * @static
8
- * @alias module:Type.isBuffer
8
+ * @alias module:Language.isBuffer
9
9
  * @since 1.0.0
10
10
  * @param {*} value 要检查的值
11
11
  * @returns {boolean} 如果值为 `buffer` ,返回 `true` ,否则返回 `false` 。
@@ -2,7 +2,7 @@
2
2
  * 检查值是否为 `DataView` 对象。
3
3
  *
4
4
  * @static
5
- * @alias module:Type.isDataView
5
+ * @alias module:Language.isDataView
6
6
  * @since 1.2.0
7
7
  * @param {*} value 要检查的值。
8
8
  * @returns {boolean} 如果值为 `DataView` 对象,返回 `true` ,否则返回 `false` 。
package/types/isDate.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * 检查值是否为 `Date` 对象。
3
3
  *
4
4
  * @static
5
- * @alias module:Type.isDate
5
+ * @alias module:Language.isDate
6
6
  * @since 1.0.0
7
7
  * @param {*} value 要检查的值。
8
8
  * @returns {boolean} 如果值为 `Date` 对象,返回 `true` ,否则返回 `false` 。