ut2 1.5.2 → 1.5.3
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 -1
- package/dist/ut2.js +96 -121
- 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/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 -1
- package/es/isError.js +3 -2
- package/es/isFunction.js +3 -2
- package/es/isMatch.js +3 -2
- 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/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 -1
- package/lib/isError.js +2 -1
- package/lib/isFunction.js +2 -1
- package/lib/isMatch.js +2 -1
- 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/native.d.ts +0 -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
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
import isArray from '../isArray.js';
|
|
2
2
|
import isSymbol from '../isSymbol.js';
|
|
3
|
+
import isUndefined from '../isUndefined.js';
|
|
3
4
|
import createIteratee from './createIteratee.js';
|
|
4
5
|
|
|
5
|
-
function createExtremum(array,
|
|
6
|
+
function createExtremum(array, comparator, iteratee) {
|
|
6
7
|
if (!isArray(array)) {
|
|
7
8
|
return;
|
|
8
9
|
}
|
|
9
10
|
var result, computed;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
if (isUndefined(iteratee)) {
|
|
12
|
+
array.forEach(function (value) {
|
|
13
|
+
if (value != null && (result === undefined ? value === value && !isSymbol(value) : comparator(value, result))) {
|
|
14
|
+
result = value;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
var internalIteratee_1 = createIteratee(iteratee);
|
|
20
|
+
array.forEach(function (value) {
|
|
21
|
+
var current = internalIteratee_1(value);
|
|
22
|
+
if (current != null && (computed === undefined ? current === current && !isSymbol(current) : comparator(current, computed))) {
|
|
23
|
+
computed = current;
|
|
24
|
+
result = value;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
21
28
|
return result;
|
|
22
29
|
}
|
|
23
30
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import identity from '../identity.js';
|
|
1
2
|
import isSymbol from '../isSymbol.js';
|
|
2
3
|
|
|
3
4
|
function createIteratee(iteratee) {
|
|
@@ -7,7 +8,7 @@ function createIteratee(iteratee) {
|
|
|
7
8
|
if (typeof iteratee === 'string' || typeof iteratee === 'number' || isSymbol(iteratee)) {
|
|
8
9
|
return function (value) { return value[iteratee]; };
|
|
9
10
|
}
|
|
10
|
-
return
|
|
11
|
+
return identity;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export { createIteratee as default };
|
package/es/internals/getTag.js
CHANGED
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { objectProtoToString } from './native.js';
|
|
2
2
|
|
|
3
|
-
function getRawTag(value) {
|
|
4
|
-
var isOwn = objectProtoHasOwnProperty.call(value, symbolToStringTag);
|
|
5
|
-
var tag = value[symbolToStringTag];
|
|
6
|
-
var unmasked = false;
|
|
7
|
-
try {
|
|
8
|
-
value[symbolToStringTag] = undefined;
|
|
9
|
-
unmasked = true;
|
|
10
|
-
}
|
|
11
|
-
catch (e) {
|
|
12
|
-
}
|
|
13
|
-
var result = objectProtoToString.call(value);
|
|
14
|
-
if (unmasked) {
|
|
15
|
-
if (isOwn) {
|
|
16
|
-
value[symbolToStringTag] = tag;
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
delete value[symbolToStringTag];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return result;
|
|
23
|
-
}
|
|
24
3
|
function getTag(value) {
|
|
25
|
-
return
|
|
4
|
+
return objectProtoToString.call(value);
|
|
26
5
|
}
|
|
27
6
|
|
|
28
7
|
export { getTag as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { dataViewTag, mapTag, promiseTag, setTag, weakMapTag, objectTag } from './native.js';
|
|
2
2
|
import { toSource } from './helpers.js';
|
|
3
3
|
import getTag from './getTag.js';
|
|
4
4
|
|
|
@@ -13,11 +13,11 @@ var promiseCtorString = toSource(Promise);
|
|
|
13
13
|
var setCtorString = toSource(Set);
|
|
14
14
|
var weakMapCtorString = toSource(WeakMap);
|
|
15
15
|
var getTagWithBugfix = getTag;
|
|
16
|
-
if ((dataViewExisted &&
|
|
17
|
-
(mapExisted &&
|
|
18
|
-
(promiseExisted &&
|
|
19
|
-
(setExisted &&
|
|
20
|
-
(weakMapExisted &&
|
|
16
|
+
if ((dataViewExisted && getTag(new DataView(new ArrayBuffer(1))) !== dataViewTag) ||
|
|
17
|
+
(mapExisted && getTag(new Map()) !== mapTag) ||
|
|
18
|
+
(promiseExisted && getTag(Promise.resolve()) !== promiseTag) ||
|
|
19
|
+
(setExisted && getTag(new Set()) !== setTag) ||
|
|
20
|
+
(weakMapExisted && getTag(new WeakMap()) !== weakMapTag)) {
|
|
21
21
|
getTagWithBugfix = function (value) {
|
|
22
22
|
var result = getTag(value);
|
|
23
23
|
var Ctor = result === objectTag ? value.constructor : undefined;
|
package/es/internals/helpers.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getTag from './getTag.js';
|
|
2
|
+
import { argumentsTag, functionProtoToString } from './native.js';
|
|
2
3
|
|
|
3
|
-
var VERSION = "1.5.
|
|
4
|
-
var supportedArgumentsType =
|
|
4
|
+
var VERSION = "1.5.3";
|
|
5
|
+
var supportedArgumentsType = getTag((function () { return arguments; })()) === argumentsTag;
|
|
5
6
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
6
7
|
function toSource(func) {
|
|
7
8
|
if (func !== null) {
|
|
@@ -18,5 +19,6 @@ function toSource(func) {
|
|
|
18
19
|
}
|
|
19
20
|
return '';
|
|
20
21
|
}
|
|
22
|
+
var stubFlase = function () { return false; };
|
|
21
23
|
|
|
22
|
-
export { FUNC_ERROR_TEXT, VERSION, supportedArgumentsType, toSource };
|
|
24
|
+
export { FUNC_ERROR_TEXT, VERSION, stubFlase, supportedArgumentsType, toSource };
|
package/es/internals/native.js
CHANGED
|
@@ -9,10 +9,8 @@ var functionProto = Function.prototype;
|
|
|
9
9
|
var functionProtoToString = functionProto.toString;
|
|
10
10
|
var symbolExisted = typeof Symbol !== 'undefined';
|
|
11
11
|
var symbolProto = symbolExisted ? Symbol.prototype : undefined;
|
|
12
|
-
var symbolToStringTag = symbolExisted ? Symbol.toStringTag : undefined;
|
|
13
12
|
var arrayProto = Array.prototype;
|
|
14
13
|
var arrayProtoSlice = arrayProto.slice;
|
|
15
|
-
var arrayProtoAt = arrayProto.at;
|
|
16
14
|
var mathMin = Math.min;
|
|
17
15
|
var mathMax = Math.max;
|
|
18
16
|
var mathRandom = Math.random;
|
|
@@ -50,4 +48,4 @@ var promiseTag = '[object Promise]';
|
|
|
50
48
|
var setTag = '[object Set]';
|
|
51
49
|
var weakMapTag = '[object WeakMap]';
|
|
52
50
|
|
|
53
|
-
export { MAX_ARRAY_LENGTH, MAX_SAFE_INTEGER, MIN_SAFE_INTEGER, argumentsTag, arrayBufferTag, arrayProto,
|
|
51
|
+
export { MAX_ARRAY_LENGTH, MAX_SAFE_INTEGER, MIN_SAFE_INTEGER, argumentsTag, arrayBufferTag, arrayProto, arrayProtoSlice, arrayTag, blobTag, booleanTag, dataViewTag, dateTag, domExceptionTag, errorTag, functionProto, functionProtoToString, functionTags, globalExisted, globalThisExisted, mapTag, mathAbs, mathCeil, mathFloor, mathMax, mathMin, mathRandom, numberIsFinite, numberIsInteger, numberIsSafeInteger, numberTag, objectGetOwnPropertySymbols, objectGetPrototypeOf, objectKeys, objectProto, objectProtoHasOwnProperty, objectProtoPropertyIsEnumerable, objectProtoToString, objectTag, promiseTag, regExpTag, selfExisted, setTag, stringTag, symbolProto, symbolTag, typedArrayTags, weakMapTag, weakSetTag };
|
package/es/isArguments.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { argumentsTag, objectProtoHasOwnProperty, objectProtoPropertyIsEnumerable } from './internals/native.js';
|
|
2
2
|
import { supportedArgumentsType } from './internals/helpers.js';
|
|
3
3
|
import isObjectLike from './isObjectLike.js';
|
|
4
|
+
import getTag from './internals/getTag.js';
|
|
4
5
|
|
|
5
6
|
function isArguments(value) {
|
|
6
7
|
if (supportedArgumentsType) {
|
|
7
|
-
return
|
|
8
|
+
return getTag(value) === argumentsTag;
|
|
8
9
|
}
|
|
9
10
|
return isObjectLike(value) && objectProtoHasOwnProperty.call(value, 'callee') && !objectProtoPropertyIsEnumerable.call(value, 'callee');
|
|
10
11
|
}
|
package/es/isArrayBuffer.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getTag from './internals/getTag.js';
|
|
2
|
+
import { arrayBufferTag } from './internals/native.js';
|
|
2
3
|
import { nodeIsArrayBuffer } from './internals/nodeUtil.js';
|
|
3
4
|
|
|
4
5
|
function isArrayBuffer(value) {
|
|
5
|
-
return nodeIsArrayBuffer ? nodeIsArrayBuffer(value) :
|
|
6
|
+
return nodeIsArrayBuffer ? nodeIsArrayBuffer(value) : getTag(value) === arrayBufferTag;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
export { isArrayBuffer as default };
|
package/es/isBlob.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getTag from './internals/getTag.js';
|
|
2
|
+
import { blobTag } from './internals/native.js';
|
|
2
3
|
|
|
3
4
|
var blobExisted = typeof Blob !== 'undefined';
|
|
4
5
|
function isBlob(value) {
|
|
5
6
|
if (blobExisted && value instanceof Blob) {
|
|
6
7
|
return true;
|
|
7
8
|
}
|
|
8
|
-
return
|
|
9
|
+
return getTag(value) === blobTag;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export { isBlob as default };
|
package/es/isBoolean.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getTag from './internals/getTag.js';
|
|
2
|
+
import { booleanTag } from './internals/native.js';
|
|
2
3
|
|
|
3
4
|
function isBoolean(value) {
|
|
4
|
-
return value === true || value === false ||
|
|
5
|
+
return value === true || value === false || getTag(value) === booleanTag;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
export { isBoolean as default };
|
package/es/isDate.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getTag from './internals/getTag.js';
|
|
2
|
+
import { dateTag } from './internals/native.js';
|
|
2
3
|
import { nodeIsDate } from './internals/nodeUtil.js';
|
|
3
4
|
|
|
4
5
|
function isDate(value) {
|
|
5
|
-
return nodeIsDate ? nodeIsDate(value) :
|
|
6
|
+
return nodeIsDate ? nodeIsDate(value) : getTag(value) === dateTag;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
export { isDate as default };
|
package/es/isEmpty.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import getTag from './internals/getTag.js';
|
|
1
2
|
import keys from './internals/keys.js';
|
|
3
|
+
import { mapTag, setTag } from './internals/native.js';
|
|
2
4
|
import isArrayLike from './isArrayLike.js';
|
|
3
|
-
import isMap from './isMap.js';
|
|
4
5
|
import isObjectLike from './isObjectLike.js';
|
|
5
|
-
import isSet from './isSet.js';
|
|
6
6
|
|
|
7
7
|
function isEmpty(value) {
|
|
8
8
|
if (value == null) {
|
|
9
9
|
return true;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
var tag = getTag(value);
|
|
12
|
+
if (tag === mapTag || tag === setTag) {
|
|
12
13
|
return !value.size;
|
|
13
14
|
}
|
|
14
15
|
if (isObjectLike(value)) {
|
package/es/isEqual.js
CHANGED
|
@@ -62,7 +62,7 @@ function isEqualDeep(value, other, customizer, strictCheck, valueStack, otherSta
|
|
|
62
62
|
case symbolTag:
|
|
63
63
|
return symbolValueOf ? symbolValueOf.call(value) === symbolValueOf.call(other) : false;
|
|
64
64
|
case errorTag:
|
|
65
|
-
return value.name
|
|
65
|
+
return value.name === other.name && value.message === other.message;
|
|
66
66
|
case dataViewTag:
|
|
67
67
|
case arrayBufferTag:
|
|
68
68
|
if (value.byteLength !== other.byteLength || (value.byteOffset && value.byteOffset !== other.byteOffset)) {
|
package/es/isError.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getTag from './internals/getTag.js';
|
|
2
|
+
import { errorTag, domExceptionTag } from './internals/native.js';
|
|
2
3
|
import isObjectLike from './isObjectLike.js';
|
|
3
4
|
|
|
4
5
|
function isError(value) {
|
|
@@ -8,7 +9,7 @@ function isError(value) {
|
|
|
8
9
|
if (value instanceof Error) {
|
|
9
10
|
return true;
|
|
10
11
|
}
|
|
11
|
-
var tag =
|
|
12
|
+
var tag = getTag(value);
|
|
12
13
|
return tag === errorTag || tag === domExceptionTag;
|
|
13
14
|
}
|
|
14
15
|
|
package/es/isFunction.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getTag from './internals/getTag.js';
|
|
2
|
+
import { functionTags } from './internals/native.js';
|
|
2
3
|
|
|
3
4
|
function isFunction(value) {
|
|
4
5
|
if (typeof value === 'function') {
|
|
5
6
|
return true;
|
|
6
7
|
}
|
|
7
|
-
var tag =
|
|
8
|
+
var tag = getTag(value);
|
|
8
9
|
return functionTags.some(function (item) { return item === tag; });
|
|
9
10
|
}
|
|
10
11
|
|
package/es/isMatch.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import allKeys from './allKeys.js';
|
|
2
|
-
import
|
|
2
|
+
import getTag from './internals/getTag.js';
|
|
3
|
+
import { objectTag } from './internals/native.js';
|
|
3
4
|
import isEqual from './isEqual.js';
|
|
4
5
|
|
|
5
6
|
function isDeepComparable(object, source) {
|
|
6
|
-
return
|
|
7
|
+
return getTag(object) === objectTag && getTag(source) === objectTag;
|
|
7
8
|
}
|
|
8
9
|
function baseIsMatch(object, source, customizer, strictCheck, objStack, srcStack, executedCustomizer) {
|
|
9
10
|
if (executedCustomizer === void 0) { executedCustomizer = false; }
|
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
|
|