ut2 1.5.2 → 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 +2 -2
- package/dist/ut2.js +103 -129
- package/dist/ut2.js.map +1 -1
- package/dist/ut2.min.js +1 -1
- package/dist/ut2.min.js.map +1 -1
- package/es/gt.js +3 -4
- package/es/gte.js +3 -4
- package/es/internals/createExtremum.js +19 -12
- package/es/internals/createIteratee.js +2 -1
- package/es/internals/getTag.js +2 -23
- package/es/internals/getTagWithBugfix.js +6 -6
- package/es/internals/helpers.js +6 -4
- package/es/internals/isEqualDeep.js +178 -0
- package/es/internals/native.js +1 -3
- package/es/isArguments.js +3 -2
- package/es/isArrayBuffer.js +3 -2
- package/es/isBlob.js +3 -2
- package/es/isBoolean.js +3 -2
- package/es/isDate.js +3 -2
- package/es/isEmpty.js +4 -3
- package/es/isEqual.js +1 -175
- package/es/isError.js +3 -2
- package/es/isFunction.js +3 -2
- package/es/isMatch.js +10 -11
- package/es/isNumber.js +3 -2
- package/es/isObject.js +1 -1
- package/es/isObjectLike.js +1 -1
- package/es/isRegExp.js +3 -2
- package/es/isString.js +3 -2
- package/es/isSymbol.js +3 -2
- package/es/isTypedArray.js +3 -2
- package/es/isWeakSet.js +3 -2
- package/es/lowerFirst.js +3 -4
- package/es/lt.js +3 -4
- package/es/lte.js +3 -4
- package/es/max.js +2 -4
- package/es/min.js +2 -4
- package/es/nth.js +2 -6
- package/es/omit.js +1 -1
- package/es/omitBy.js +2 -1
- package/es/pickBy.js +2 -1
- package/es/toString.js +1 -1
- package/es/uniq.js +13 -5
- package/es/upperFirst.js +3 -4
- package/lib/gt.js +3 -4
- package/lib/gte.js +3 -4
- package/lib/internals/createExtremum.js +19 -12
- package/lib/internals/createIteratee.js +2 -1
- package/lib/internals/getTag.js +1 -22
- package/lib/internals/getTagWithBugfix.js +5 -5
- package/lib/internals/helpers.js +4 -2
- package/lib/internals/isEqualDeep.js +180 -0
- package/lib/internals/native.js +0 -2
- package/lib/isArguments.js +2 -1
- package/lib/isArrayBuffer.js +2 -1
- package/lib/isBlob.js +2 -1
- package/lib/isBoolean.js +2 -1
- package/lib/isDate.js +2 -1
- package/lib/isEmpty.js +4 -3
- package/lib/isEqual.js +1 -175
- package/lib/isError.js +2 -1
- package/lib/isFunction.js +2 -1
- package/lib/isMatch.js +9 -10
- package/lib/isNumber.js +2 -1
- package/lib/isObject.js +1 -1
- package/lib/isObjectLike.js +1 -1
- package/lib/isRegExp.js +2 -1
- package/lib/isString.js +2 -1
- package/lib/isSymbol.js +2 -1
- package/lib/isTypedArray.js +2 -1
- package/lib/isWeakSet.js +2 -1
- package/lib/lowerFirst.js +3 -4
- package/lib/lt.js +3 -4
- package/lib/lte.js +3 -4
- package/lib/max.js +2 -4
- package/lib/min.js +2 -4
- package/lib/nth.js +2 -6
- package/lib/omit.js +1 -1
- package/lib/omitBy.js +2 -1
- package/lib/pickBy.js +2 -1
- package/lib/toString.js +1 -1
- package/lib/uniq.js +13 -5
- package/lib/upperFirst.js +3 -4
- package/package.json +7 -2
- package/types/gt.d.ts +2 -2
- package/types/gte.d.ts +2 -2
- package/types/identity.d.ts +1 -1
- package/types/internals/createExtremum.d.ts +1 -1
- package/types/internals/createIteratee.d.ts +2 -1
- package/types/internals/decimalAdjust.d.ts +1 -1
- package/types/internals/getTag.d.ts +1 -1
- package/types/internals/helpers.d.ts +1 -0
- package/types/internals/isEqualDeep.d.ts +26 -0
- package/types/internals/native.d.ts +0 -2
- package/types/isEqual.d.ts +2 -2
- package/types/lowerFirst.d.ts +2 -2
- package/types/lt.d.ts +2 -2
- package/types/lte.d.ts +2 -2
- package/types/upperFirst.d.ts +2 -2
package/es/isMatch.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import allKeys from './allKeys.js';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import getTag from './internals/getTag.js';
|
|
3
|
+
import { objectTag } from './internals/native.js';
|
|
4
|
+
import isEqualDeep from './internals/isEqualDeep.js';
|
|
4
5
|
|
|
5
6
|
function isDeepComparable(object, source) {
|
|
6
|
-
return
|
|
7
|
+
return getTag(object) === objectTag && getTag(source) === objectTag;
|
|
7
8
|
}
|
|
8
|
-
function baseIsMatch(object, source, customizer, strictCheck, objStack, srcStack
|
|
9
|
-
if (executedCustomizer === void 0) { executedCustomizer = false; }
|
|
9
|
+
function baseIsMatch(object, source, customizer, strictCheck, objStack, srcStack) {
|
|
10
10
|
var hasCustomizer = typeof customizer === 'function';
|
|
11
11
|
if (isDeepComparable(object, source)) {
|
|
12
12
|
objStack = objStack || [];
|
|
@@ -35,7 +35,7 @@ function baseIsMatch(object, source, customizer, strictCheck, objStack, srcStack
|
|
|
35
35
|
continue;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
if (!baseIsMatch(object[key], source[key], customizer, strictCheck, objStack, srcStack
|
|
38
|
+
if (!baseIsMatch(object[key], source[key], customizer, strictCheck, objStack, srcStack)) {
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -43,18 +43,17 @@ function baseIsMatch(object, source, customizer, strictCheck, objStack, srcStack
|
|
|
43
43
|
srcStack.pop();
|
|
44
44
|
return true;
|
|
45
45
|
}
|
|
46
|
-
var result =
|
|
47
|
-
if (
|
|
46
|
+
var result = isEqualDeep(object, source, function (objValue, srcValue, k, obj, src) {
|
|
47
|
+
if (hasCustomizer) {
|
|
48
48
|
var compared = customizer(objValue, srcValue, k, obj, src, objStack, srcStack);
|
|
49
49
|
if (compared !== undefined) {
|
|
50
50
|
return compared;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
executedCustomizer = false;
|
|
54
53
|
if (isDeepComparable(objValue, srcValue)) {
|
|
55
54
|
return baseIsMatch(objValue, srcValue, customizer, strictCheck, objStack, srcStack);
|
|
56
55
|
}
|
|
57
|
-
}, strictCheck);
|
|
56
|
+
}, strictCheck, objStack, srcStack);
|
|
58
57
|
return result;
|
|
59
58
|
}
|
|
60
59
|
function isMatch(object, source, customizer, strictCheck) {
|
|
@@ -65,7 +64,7 @@ function isMatch(object, source, customizer, strictCheck) {
|
|
|
65
64
|
return !!compared;
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
|
-
return baseIsMatch(object, source, customizer, strictCheck, undefined, undefined
|
|
67
|
+
return baseIsMatch(object, source, customizer, strictCheck, undefined, undefined);
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
export { isMatch as default };
|
package/es/isNumber.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getTag from './internals/getTag.js';
|
|
2
|
+
import { numberTag } from './internals/native.js';
|
|
2
3
|
|
|
3
4
|
function isNumber(value) {
|
|
4
|
-
return typeof value === 'number' ||
|
|
5
|
+
return typeof value === 'number' || getTag(value) === numberTag;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
export { isNumber as default };
|
package/es/isObject.js
CHANGED
package/es/isObjectLike.js
CHANGED
package/es/isRegExp.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getTag from './internals/getTag.js';
|
|
2
|
+
import { regExpTag } from './internals/native.js';
|
|
2
3
|
import { nodeIsRegExp } from './internals/nodeUtil.js';
|
|
3
4
|
|
|
4
5
|
function isRegExp(value) {
|
|
5
|
-
return nodeIsRegExp ? nodeIsRegExp(value) :
|
|
6
|
+
return nodeIsRegExp ? nodeIsRegExp(value) : getTag(value) === regExpTag;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
export { isRegExp as default };
|
package/es/isString.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getTag from './internals/getTag.js';
|
|
2
|
+
import { stringTag } from './internals/native.js';
|
|
2
3
|
|
|
3
4
|
function isString(value) {
|
|
4
|
-
return typeof value === 'string' ||
|
|
5
|
+
return typeof value === 'string' || getTag(value) === stringTag;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
export { isString as default };
|
package/es/isSymbol.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getTag from './internals/getTag.js';
|
|
2
|
+
import { symbolTag } from './internals/native.js';
|
|
2
3
|
|
|
3
4
|
function isSymbol(value) {
|
|
4
|
-
return typeof value === 'symbol' ||
|
|
5
|
+
return typeof value === 'symbol' || getTag(value) === symbolTag;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
export { isSymbol as default };
|
package/es/isTypedArray.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getTag from './internals/getTag.js';
|
|
2
|
+
import { typedArrayTags } from './internals/native.js';
|
|
2
3
|
import { nodeIsTypedArray } from './internals/nodeUtil.js';
|
|
3
4
|
import isLength from './isLength.js';
|
|
4
5
|
import isObjectLike from './isObjectLike.js';
|
|
@@ -8,7 +9,7 @@ function isTypedArray(value) {
|
|
|
8
9
|
return nodeIsTypedArray(value);
|
|
9
10
|
}
|
|
10
11
|
if (isObjectLike(value) && isLength(value.length)) {
|
|
11
|
-
var tag_1 =
|
|
12
|
+
var tag_1 = getTag(value);
|
|
12
13
|
return typedArrayTags.some(function (item) { return item === tag_1; });
|
|
13
14
|
}
|
|
14
15
|
return false;
|
package/es/isWeakSet.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getTag from './internals/getTag.js';
|
|
2
|
+
import { weakSetTag } from './internals/native.js';
|
|
2
3
|
|
|
3
4
|
function isWeakSet(value) {
|
|
4
|
-
return
|
|
5
|
+
return getTag(value) === weakSetTag;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
export { isWeakSet as default };
|
package/es/lowerFirst.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import createCaseFirst from './internals/createCaseFirst.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
3
|
+
var lowerFirst = createCaseFirst('toLowerCase');
|
|
4
|
+
var lowerFirst$1 = lowerFirst;
|
|
6
5
|
|
|
7
|
-
export { lowerFirst as default };
|
|
6
|
+
export { lowerFirst$1 as default };
|
package/es/lt.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createOperation, baseLt } from './internals/comparator.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
3
|
+
var lt = createOperation(baseLt);
|
|
4
|
+
var lt$1 = lt;
|
|
6
5
|
|
|
7
|
-
export { lt as default };
|
|
6
|
+
export { lt$1 as default };
|
package/es/lte.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createOperation, baseLte } from './internals/comparator.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
3
|
+
var lte = createOperation(baseLte);
|
|
4
|
+
var lte$1 = lte;
|
|
6
5
|
|
|
7
|
-
export { lte as default };
|
|
6
|
+
export { lte$1 as default };
|
package/es/max.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import identity from './identity.js';
|
|
1
|
+
import { baseGt } from './internals/comparator.js';
|
|
3
2
|
import createExtremum from './internals/createExtremum.js';
|
|
4
3
|
|
|
5
4
|
function max(array, iteratee) {
|
|
6
|
-
|
|
7
|
-
return createExtremum(array, iteratee, gt);
|
|
5
|
+
return createExtremum(array, baseGt, iteratee);
|
|
8
6
|
}
|
|
9
7
|
|
|
10
8
|
export { max as default };
|
package/es/min.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { baseLt } from './internals/comparator.js';
|
|
2
2
|
import createExtremum from './internals/createExtremum.js';
|
|
3
|
-
import lt from './lt.js';
|
|
4
3
|
|
|
5
4
|
function min(array, iteratee) {
|
|
6
|
-
|
|
7
|
-
return createExtremum(array, iteratee, lt);
|
|
5
|
+
return createExtremum(array, baseLt, iteratee);
|
|
8
6
|
}
|
|
9
7
|
|
|
10
8
|
export { min as default };
|
package/es/nth.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { arrayProtoAt } from './internals/native.js';
|
|
2
1
|
import isArrayLike from './isArrayLike.js';
|
|
3
2
|
|
|
4
3
|
function nth(array, n) {
|
|
@@ -6,11 +5,8 @@ function nth(array, n) {
|
|
|
6
5
|
if (!isArrayLike(array)) {
|
|
7
6
|
return undefined;
|
|
8
7
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
var index = n < 0 ? n + array.length : n;
|
|
13
|
-
return array[index];
|
|
8
|
+
n += n < 0 ? array.length : 0;
|
|
9
|
+
return array[n];
|
|
14
10
|
}
|
|
15
11
|
|
|
16
12
|
export { nth as default };
|
package/es/omit.js
CHANGED
package/es/omitBy.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { stubFlase } from './internals/helpers.js';
|
|
1
2
|
import negate from './negate.js';
|
|
2
3
|
import pickBy from './pickBy.js';
|
|
3
4
|
|
|
4
5
|
function omitBy(object, predicate) {
|
|
5
|
-
if (predicate === void 0) { predicate =
|
|
6
|
+
if (predicate === void 0) { predicate = stubFlase; }
|
|
6
7
|
return pickBy(object, negate(predicate));
|
|
7
8
|
}
|
|
8
9
|
|
package/es/pickBy.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import allKeysIn from './allKeysIn.js';
|
|
2
|
+
import { stubFlase } from './internals/helpers.js';
|
|
2
3
|
|
|
3
4
|
function pickBy(object, predicate) {
|
|
4
|
-
if (predicate === void 0) { predicate =
|
|
5
|
+
if (predicate === void 0) { predicate = stubFlase; }
|
|
5
6
|
var result = {};
|
|
6
7
|
if (object === null) {
|
|
7
8
|
return result;
|
package/es/toString.js
CHANGED
|
@@ -14,7 +14,7 @@ function baseToString(value) {
|
|
|
14
14
|
return symbolToString ? symbolToString.call(value) : '';
|
|
15
15
|
}
|
|
16
16
|
var result = '' + value;
|
|
17
|
-
return result
|
|
17
|
+
return result === '0' && 1 / value === -Infinity ? '-0' : result;
|
|
18
18
|
}
|
|
19
19
|
function toString(value) {
|
|
20
20
|
return value == null ? '' : baseToString(value);
|
package/es/uniq.js
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import eq from './eq.js';
|
|
2
2
|
import createIteratee from './internals/createIteratee.js';
|
|
3
3
|
import isArray from './isArray.js';
|
|
4
|
+
import isUndefined from './isUndefined.js';
|
|
4
5
|
|
|
5
6
|
function uniq(array, iteratee, strickCheck) {
|
|
6
7
|
if (strickCheck === void 0) { strickCheck = false; }
|
|
7
8
|
if (!isArray(array)) {
|
|
8
9
|
return [];
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
11
|
+
if (isUndefined(iteratee)) {
|
|
12
|
+
return array.filter(function (value, index, arr) {
|
|
13
|
+
return arr.findIndex(function (item) { return eq(item, value, strickCheck); }) === index;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
var internalIteratee_1 = createIteratee(iteratee);
|
|
18
|
+
return array.filter(function (value, index, arr) {
|
|
19
|
+
var current = internalIteratee_1(value);
|
|
20
|
+
return arr.findIndex(function (item) { return eq(internalIteratee_1(item), current, strickCheck); }) === index;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
15
23
|
}
|
|
16
24
|
|
|
17
25
|
export { uniq as default };
|
package/es/upperFirst.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import createCaseFirst from './internals/createCaseFirst.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
3
|
+
var upperFirst = createCaseFirst('toUpperCase');
|
|
4
|
+
var upperFirst$1 = upperFirst;
|
|
6
5
|
|
|
7
|
-
export { upperFirst as default };
|
|
6
|
+
export { upperFirst$1 as default };
|
package/lib/gt.js
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var comparator = require('./internals/comparator.js');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
5
|
+
var gt = comparator.createOperation(comparator.baseGt);
|
|
6
|
+
var gt$1 = gt;
|
|
8
7
|
|
|
9
|
-
module.exports = gt;
|
|
8
|
+
module.exports = gt$1;
|
package/lib/gte.js
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var comparator = require('./internals/comparator.js');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
5
|
+
var gte = comparator.createOperation(comparator.baseGte);
|
|
6
|
+
var gte$1 = gte;
|
|
8
7
|
|
|
9
|
-
module.exports = gte;
|
|
8
|
+
module.exports = gte$1;
|
|
@@ -2,24 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
var isArray = require('../isArray.js');
|
|
4
4
|
var isSymbol = require('../isSymbol.js');
|
|
5
|
+
var isUndefined = require('../isUndefined.js');
|
|
5
6
|
var createIteratee = require('./createIteratee.js');
|
|
6
7
|
|
|
7
|
-
function createExtremum(array,
|
|
8
|
+
function createExtremum(array, comparator, iteratee) {
|
|
8
9
|
if (!isArray(array)) {
|
|
9
10
|
return;
|
|
10
11
|
}
|
|
11
12
|
var result, computed;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
if (isUndefined(iteratee)) {
|
|
14
|
+
array.forEach(function (value) {
|
|
15
|
+
if (value != null && (result === undefined ? value === value && !isSymbol(value) : comparator(value, result))) {
|
|
16
|
+
result = value;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
var internalIteratee_1 = createIteratee(iteratee);
|
|
22
|
+
array.forEach(function (value) {
|
|
23
|
+
var current = internalIteratee_1(value);
|
|
24
|
+
if (current != null && (computed === undefined ? current === current && !isSymbol(current) : comparator(current, computed))) {
|
|
25
|
+
computed = current;
|
|
26
|
+
result = value;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
23
30
|
return result;
|
|
24
31
|
}
|
|
25
32
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var identity = require('../identity.js');
|
|
3
4
|
var isSymbol = require('../isSymbol.js');
|
|
4
5
|
|
|
5
6
|
function createIteratee(iteratee) {
|
|
@@ -9,7 +10,7 @@ function createIteratee(iteratee) {
|
|
|
9
10
|
if (typeof iteratee === 'string' || typeof iteratee === 'number' || isSymbol(iteratee)) {
|
|
10
11
|
return function (value) { return value[iteratee]; };
|
|
11
12
|
}
|
|
12
|
-
return
|
|
13
|
+
return identity;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
module.exports = createIteratee;
|
package/lib/internals/getTag.js
CHANGED
|
@@ -2,29 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var native = require('./native.js');
|
|
4
4
|
|
|
5
|
-
function getRawTag(value) {
|
|
6
|
-
var isOwn = native.objectProtoHasOwnProperty.call(value, native.symbolToStringTag);
|
|
7
|
-
var tag = value[native.symbolToStringTag];
|
|
8
|
-
var unmasked = false;
|
|
9
|
-
try {
|
|
10
|
-
value[native.symbolToStringTag] = undefined;
|
|
11
|
-
unmasked = true;
|
|
12
|
-
}
|
|
13
|
-
catch (e) {
|
|
14
|
-
}
|
|
15
|
-
var result = native.objectProtoToString.call(value);
|
|
16
|
-
if (unmasked) {
|
|
17
|
-
if (isOwn) {
|
|
18
|
-
value[native.symbolToStringTag] = tag;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
delete value[native.symbolToStringTag];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return result;
|
|
25
|
-
}
|
|
26
5
|
function getTag(value) {
|
|
27
|
-
return native.
|
|
6
|
+
return native.objectProtoToString.call(value);
|
|
28
7
|
}
|
|
29
8
|
|
|
30
9
|
module.exports = getTag;
|
|
@@ -15,11 +15,11 @@ var promiseCtorString = helpers.toSource(Promise);
|
|
|
15
15
|
var setCtorString = helpers.toSource(Set);
|
|
16
16
|
var weakMapCtorString = helpers.toSource(WeakMap);
|
|
17
17
|
var getTagWithBugfix = getTag;
|
|
18
|
-
if ((dataViewExisted &&
|
|
19
|
-
(mapExisted &&
|
|
20
|
-
(promiseExisted &&
|
|
21
|
-
(setExisted &&
|
|
22
|
-
(weakMapExisted &&
|
|
18
|
+
if ((dataViewExisted && getTag(new DataView(new ArrayBuffer(1))) !== native.dataViewTag) ||
|
|
19
|
+
(mapExisted && getTag(new Map()) !== native.mapTag) ||
|
|
20
|
+
(promiseExisted && getTag(Promise.resolve()) !== native.promiseTag) ||
|
|
21
|
+
(setExisted && getTag(new Set()) !== native.setTag) ||
|
|
22
|
+
(weakMapExisted && getTag(new WeakMap()) !== native.weakMapTag)) {
|
|
23
23
|
getTagWithBugfix = function (value) {
|
|
24
24
|
var result = getTag(value);
|
|
25
25
|
var Ctor = result === native.objectTag ? value.constructor : undefined;
|
package/lib/internals/helpers.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var getTag = require('./getTag.js');
|
|
3
4
|
var native = require('./native.js');
|
|
4
5
|
|
|
5
|
-
exports.VERSION = "1.5.
|
|
6
|
-
exports.supportedArgumentsType =
|
|
6
|
+
exports.VERSION = "1.5.4";
|
|
7
|
+
exports.supportedArgumentsType = getTag((function () { return arguments; })()) === native.argumentsTag;
|
|
7
8
|
exports.FUNC_ERROR_TEXT = 'Expected a function';
|
|
8
9
|
function toSource(func) {
|
|
9
10
|
if (func !== null) {
|
|
@@ -20,5 +21,6 @@ function toSource(func) {
|
|
|
20
21
|
}
|
|
21
22
|
return '';
|
|
22
23
|
}
|
|
24
|
+
exports.stubFlase = function () { return false; };
|
|
23
25
|
|
|
24
26
|
exports.toSource = toSource;
|