ut2 1.7.1 → 1.7.2
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 +133 -133
- package/dist/ut2.js +51 -55
- package/dist/ut2.js.map +1 -1
- package/dist/ut2.min.js +1 -1
- package/dist/ut2.min.js.map +1 -1
- package/es/clamp.js +4 -3
- package/es/conformsTo.js +4 -3
- package/es/countBy.js +4 -3
- package/es/defaultTo.js +4 -3
- package/es/every.js +4 -3
- package/es/filter.js +4 -3
- package/es/find.js +4 -3
- package/es/fromPairs.js +4 -3
- package/es/groupBy.js +4 -3
- package/es/internals/baseDebounce.js +2 -8
- package/es/internals/createForEach.js +2 -2
- package/es/internals/createReduce.js +2 -2
- package/es/internals/helpers.js +1 -1
- package/es/keyBy.js +4 -3
- package/es/map.js +4 -3
- package/es/orderBy.js +4 -3
- package/es/partial.js +16 -11
- package/es/partition.js +4 -3
- package/es/range.js +4 -3
- package/es/some.js +4 -3
- package/es/times.js +4 -3
- package/lib/clamp.js +4 -3
- package/lib/conformsTo.js +4 -3
- package/lib/countBy.js +4 -3
- package/lib/defaultTo.js +4 -3
- package/lib/every.js +4 -3
- package/lib/filter.js +4 -3
- package/lib/find.js +4 -3
- package/lib/fromPairs.js +4 -3
- package/lib/groupBy.js +4 -3
- package/lib/index.js +4 -4
- package/lib/internals/baseDebounce.js +2 -8
- package/lib/internals/createForEach.js +2 -2
- package/lib/internals/createReduce.js +2 -2
- package/lib/internals/helpers.js +1 -1
- package/lib/keyBy.js +4 -3
- package/lib/map.js +4 -3
- package/lib/orderBy.js +4 -3
- package/lib/partial.js +16 -11
- package/lib/partition.js +4 -3
- package/lib/range.js +4 -3
- package/lib/some.js +4 -3
- package/lib/times.js +4 -3
- package/package.json +26 -24
- package/types/after.d.ts +2 -1
- package/types/before.d.ts +2 -1
- package/types/clamp.d.ts +29 -2
- package/types/conformsTo.d.ts +23 -2
- package/types/countBy.d.ts +28 -2
- package/types/debounce.d.ts +2 -1
- package/types/defaultTo.d.ts +6 -3
- package/types/delay.d.ts +2 -1
- package/types/every.d.ts +28 -4
- package/types/filter.d.ts +26 -4
- package/types/find.d.ts +26 -4
- package/types/forEach.d.ts +1 -6
- package/types/forEachRight.d.ts +1 -6
- package/types/fromPairs.d.ts +20 -2
- package/types/groupBy.d.ts +28 -2
- package/types/internals/baseDebounce.d.ts +2 -1
- package/types/internals/createForEach.d.ts +7 -6
- package/types/internals/createReduce.d.ts +11 -10
- package/types/internals/types.d.ts +1 -0
- package/types/isFunction.d.ts +2 -1
- package/types/keyBy.d.ts +28 -2
- package/types/map.d.ts +28 -4
- package/types/negate.d.ts +2 -1
- package/types/once.d.ts +2 -1
- package/types/orderBy.d.ts +43 -2
- package/types/partial.d.ts +63 -11
- package/types/partition.d.ts +38 -2
- package/types/range.d.ts +28 -3
- package/types/reduce.d.ts +1 -10
- package/types/reduceRight.d.ts +1 -10
- package/types/some.d.ts +26 -4
- package/types/throttle.d.ts +2 -1
- package/types/times.d.ts +25 -2
package/es/clamp.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import defaultTo from './defaultTo.js';
|
|
2
2
|
import toNumber from './toNumber.js';
|
|
3
3
|
|
|
4
|
-
function
|
|
4
|
+
var clamp = function (number, lower, upper) {
|
|
5
5
|
if (upper === undefined) {
|
|
6
6
|
upper = lower;
|
|
7
7
|
lower = undefined;
|
|
@@ -22,6 +22,7 @@ function clamp(number, lower, upper) {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
return number;
|
|
25
|
-
}
|
|
25
|
+
};
|
|
26
|
+
var clamp$1 = clamp;
|
|
26
27
|
|
|
27
|
-
export { clamp as default };
|
|
28
|
+
export { clamp$1 as default };
|
package/es/conformsTo.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import allKeys from './allKeys.js';
|
|
2
2
|
import isNil from './isNil.js';
|
|
3
3
|
|
|
4
|
-
function
|
|
4
|
+
var conformsTo = function (object, source) {
|
|
5
5
|
var props = allKeys(source);
|
|
6
6
|
var length = props.length;
|
|
7
7
|
if (isNil(object)) {
|
|
@@ -19,6 +19,7 @@ function conformsTo(object, source) {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
return true;
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
|
+
var conformsTo$1 = conformsTo;
|
|
23
24
|
|
|
24
|
-
export { conformsTo as default };
|
|
25
|
+
export { conformsTo$1 as default };
|
package/es/countBy.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import forEach from './forEach.js';
|
|
2
2
|
import createIteratee from './internals/createIteratee.js';
|
|
3
3
|
|
|
4
|
-
function
|
|
4
|
+
var countBy = function (collection, iteratee) {
|
|
5
5
|
var result = {};
|
|
6
6
|
var internalIteratee = createIteratee(iteratee);
|
|
7
7
|
forEach(collection, function (item) {
|
|
@@ -14,6 +14,7 @@ function countBy(collection, iteratee) {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
return result;
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
|
+
var countBy$1 = countBy;
|
|
18
19
|
|
|
19
|
-
export { countBy as default };
|
|
20
|
+
export { countBy$1 as default };
|
package/es/defaultTo.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
function
|
|
1
|
+
var defaultTo = function (value, defaultValue) {
|
|
2
2
|
return value == null || value !== value ? defaultValue : value;
|
|
3
|
-
}
|
|
3
|
+
};
|
|
4
|
+
var defaultTo$1 = defaultTo;
|
|
4
5
|
|
|
5
|
-
export { defaultTo as default };
|
|
6
|
+
export { defaultTo$1 as default };
|
package/es/every.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import forEach from './forEach.js';
|
|
2
2
|
import identity from './identity.js';
|
|
3
3
|
|
|
4
|
-
function
|
|
4
|
+
var every = function (collection, predicate) {
|
|
5
5
|
if (predicate === void 0) { predicate = identity; }
|
|
6
6
|
var result = true;
|
|
7
7
|
forEach(collection, function (item, index, arr) {
|
|
@@ -11,6 +11,7 @@ function every(collection, predicate) {
|
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
return result;
|
|
14
|
-
}
|
|
14
|
+
};
|
|
15
|
+
var every$1 = every;
|
|
15
16
|
|
|
16
|
-
export { every as default };
|
|
17
|
+
export { every$1 as default };
|
package/es/filter.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import forEach from './forEach.js';
|
|
2
2
|
import identity from './identity.js';
|
|
3
3
|
|
|
4
|
-
function
|
|
4
|
+
var filter = function (array, predicate) {
|
|
5
5
|
if (predicate === void 0) { predicate = identity; }
|
|
6
6
|
var results = [];
|
|
7
7
|
forEach(array, function (item, index) {
|
|
@@ -10,6 +10,7 @@ function filter(array, predicate) {
|
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
return results;
|
|
13
|
-
}
|
|
13
|
+
};
|
|
14
|
+
var filter$1 = filter;
|
|
14
15
|
|
|
15
|
-
export { filter as default };
|
|
16
|
+
export { filter$1 as default };
|
package/es/find.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import forEach from './forEach.js';
|
|
2
2
|
import identity from './identity.js';
|
|
3
3
|
|
|
4
|
-
function
|
|
4
|
+
var find = function (collection, predicate) {
|
|
5
5
|
if (predicate === void 0) { predicate = identity; }
|
|
6
6
|
var result;
|
|
7
7
|
forEach(collection, function (item, index, arr) {
|
|
@@ -11,6 +11,7 @@ function find(collection, predicate) {
|
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
return result;
|
|
14
|
-
}
|
|
14
|
+
};
|
|
15
|
+
var find$1 = find;
|
|
15
16
|
|
|
16
|
-
export { find as default };
|
|
17
|
+
export { find$1 as default };
|
package/es/fromPairs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import isArray from './isArray.js';
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
var fromPairs = function (array) {
|
|
4
4
|
var result = {};
|
|
5
5
|
if (!isArray(array)) {
|
|
6
6
|
return result;
|
|
@@ -9,6 +9,7 @@ function fromPairs(array) {
|
|
|
9
9
|
result[item[0]] = item[1];
|
|
10
10
|
});
|
|
11
11
|
return result;
|
|
12
|
-
}
|
|
12
|
+
};
|
|
13
|
+
var fromPairs$1 = fromPairs;
|
|
13
14
|
|
|
14
|
-
export { fromPairs as default };
|
|
15
|
+
export { fromPairs$1 as default };
|
package/es/groupBy.js
CHANGED
|
@@ -2,7 +2,7 @@ import forEach from './forEach.js';
|
|
|
2
2
|
import identity from './identity.js';
|
|
3
3
|
import createIteratee from './internals/createIteratee.js';
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
var groupBy = function (collection, iteratee) {
|
|
6
6
|
if (iteratee === void 0) { iteratee = identity; }
|
|
7
7
|
var result = {};
|
|
8
8
|
var internalIteratee = createIteratee(iteratee);
|
|
@@ -16,6 +16,7 @@ function groupBy(collection, iteratee) {
|
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
return result;
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
|
+
var groupBy$1 = groupBy;
|
|
20
21
|
|
|
21
|
-
export { groupBy as default };
|
|
22
|
+
export { groupBy$1 as default };
|
|
@@ -15,9 +15,7 @@ function baseDebounce(func, wait, immediate, __throttle__) {
|
|
|
15
15
|
}
|
|
16
16
|
var timeSinceLastCall = time - lastCallTime;
|
|
17
17
|
var timeSinceLastInvoke = time - lastInvokeTime;
|
|
18
|
-
return
|
|
19
|
-
timeSinceLastCall < 0 ||
|
|
20
|
-
(__throttle__ && timeSinceLastInvoke >= wait));
|
|
18
|
+
return timeSinceLastCall >= wait || timeSinceLastCall < 0 || (__throttle__ && timeSinceLastInvoke >= wait);
|
|
21
19
|
}
|
|
22
20
|
function invokeFunc(time) {
|
|
23
21
|
lastInvokeTime = time;
|
|
@@ -34,11 +32,7 @@ function baseDebounce(func, wait, immediate, __throttle__) {
|
|
|
34
32
|
lastArgs = args;
|
|
35
33
|
var time = Date.now();
|
|
36
34
|
var isInvoke = shouldInvoke(time);
|
|
37
|
-
var waitTime = !__throttle__
|
|
38
|
-
? wait
|
|
39
|
-
: !isInvoke && lastCallTime !== undefined && timer === undefined
|
|
40
|
-
? wait - (time - lastCallTime)
|
|
41
|
-
: wait;
|
|
35
|
+
var waitTime = !__throttle__ ? wait : !isInvoke && lastCallTime !== undefined && timer === undefined ? wait - (time - lastCallTime) : wait;
|
|
42
36
|
lastCallTime = time;
|
|
43
37
|
if (isInvoke) {
|
|
44
38
|
if (immediate && timer === undefined) {
|
|
@@ -3,7 +3,7 @@ import isArrayLike from '../isArrayLike.js';
|
|
|
3
3
|
import keys from '../keys.js';
|
|
4
4
|
|
|
5
5
|
function createForEach(dir) {
|
|
6
|
-
function
|
|
6
|
+
var forEach = function (collection, iteratee) {
|
|
7
7
|
if (iteratee === void 0) { iteratee = identity; }
|
|
8
8
|
var _keys = !isArrayLike(collection) && keys(collection);
|
|
9
9
|
var len = (_keys || collection).length;
|
|
@@ -16,7 +16,7 @@ function createForEach(dir) {
|
|
|
16
16
|
i += dir;
|
|
17
17
|
}
|
|
18
18
|
return collection;
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
return forEach;
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -18,11 +18,11 @@ function createReduce(dir) {
|
|
|
18
18
|
}
|
|
19
19
|
return memo;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
var reduce = function (collection, iteratee, initialValue) {
|
|
22
22
|
if (iteratee === void 0) { iteratee = identity; }
|
|
23
23
|
var initial = arguments.length >= 3;
|
|
24
24
|
return reducer(collection, iteratee, initialValue, initial);
|
|
25
|
-
}
|
|
25
|
+
};
|
|
26
26
|
return reduce;
|
|
27
27
|
}
|
|
28
28
|
|
package/es/internals/helpers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import getTag from './getTag.js';
|
|
2
2
|
import { argumentsTag, functionProtoToString } from './native.js';
|
|
3
3
|
|
|
4
|
-
var VERSION = "1.7.
|
|
4
|
+
var VERSION = "1.7.2";
|
|
5
5
|
var supportedArgumentsType = getTag((function () { return arguments; })()) === argumentsTag;
|
|
6
6
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
7
7
|
function toSource(func) {
|
package/es/keyBy.js
CHANGED
|
@@ -2,7 +2,7 @@ import forEach from './forEach.js';
|
|
|
2
2
|
import identity from './identity.js';
|
|
3
3
|
import createIteratee from './internals/createIteratee.js';
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
var keyBy = function (collection, iteratee) {
|
|
6
6
|
if (iteratee === void 0) { iteratee = identity; }
|
|
7
7
|
var result = {};
|
|
8
8
|
var internalIteratee = createIteratee(iteratee);
|
|
@@ -11,6 +11,7 @@ function keyBy(collection, iteratee) {
|
|
|
11
11
|
result[key] = item;
|
|
12
12
|
});
|
|
13
13
|
return result;
|
|
14
|
-
}
|
|
14
|
+
};
|
|
15
|
+
var keyBy$1 = keyBy;
|
|
15
16
|
|
|
16
|
-
export { keyBy as default };
|
|
17
|
+
export { keyBy$1 as default };
|
package/es/map.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import forEach from './forEach.js';
|
|
2
2
|
import identity from './identity.js';
|
|
3
3
|
|
|
4
|
-
function
|
|
4
|
+
var map = function (collection, iteratee) {
|
|
5
5
|
if (iteratee === void 0) { iteratee = identity; }
|
|
6
6
|
var result = [];
|
|
7
7
|
forEach(collection, function (item, index, arr) {
|
|
8
8
|
result.push(iteratee(item, index, arr));
|
|
9
9
|
});
|
|
10
10
|
return result;
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
|
+
var map$1 = map;
|
|
12
13
|
|
|
13
|
-
export { map as default };
|
|
14
|
+
export { map$1 as default };
|
package/es/orderBy.js
CHANGED
|
@@ -4,7 +4,7 @@ import { compareMultiple } from './internals/compare.js';
|
|
|
4
4
|
import isArray from './isArray.js';
|
|
5
5
|
import forEach from './forEach.js';
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
var orderBy = function (collection, iteratees, orders) {
|
|
8
8
|
var result = [];
|
|
9
9
|
iteratees = (isArray(iteratees) ? iteratees : iteratees !== undefined ? [iteratees] : [identity]);
|
|
10
10
|
orders = (isArray(orders) ? orders : orders !== undefined ? [orders] : []);
|
|
@@ -18,6 +18,7 @@ function orderBy(collection, iteratees, orders) {
|
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
20
|
return result.sort(function (a, b) { return compareMultiple(a, b, orders); }).map(function (item) { return item.value; });
|
|
21
|
-
}
|
|
21
|
+
};
|
|
22
|
+
var orderBy$1 = orderBy;
|
|
22
23
|
|
|
23
|
-
export { orderBy as default };
|
|
24
|
+
export { orderBy$1 as default };
|
package/es/partial.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { arrayProtoSlice } from './internals/native.js';
|
|
2
|
+
|
|
3
|
+
var PLACEHOLDER = {
|
|
4
|
+
__ut2_partial__: 1
|
|
5
|
+
};
|
|
6
|
+
var partial = function (func) {
|
|
7
|
+
var argsOrig = arrayProtoSlice.call(arguments, 1);
|
|
6
8
|
return function () {
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
var args = [];
|
|
10
|
+
var argsPartial = arrayProtoSlice.call(arguments);
|
|
11
|
+
for (var i = 0; i < argsOrig.length; i++) {
|
|
12
|
+
args[i] = argsOrig[i] === PLACEHOLDER ? argsPartial.shift() : argsOrig[i];
|
|
10
13
|
}
|
|
11
|
-
return func.apply(this, args.concat(
|
|
14
|
+
return func.apply(this, args.concat(argsPartial));
|
|
12
15
|
};
|
|
13
|
-
}
|
|
16
|
+
};
|
|
17
|
+
partial.placeholder = partial._ = PLACEHOLDER;
|
|
18
|
+
var partial$1 = partial;
|
|
14
19
|
|
|
15
|
-
export { partial as default };
|
|
20
|
+
export { partial$1 as default };
|
package/es/partition.js
CHANGED
|
@@ -2,7 +2,7 @@ import forEach from './forEach.js';
|
|
|
2
2
|
import identity from './identity.js';
|
|
3
3
|
import createIteratee from './internals/createIteratee.js';
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
var partition = function (collection, predicate) {
|
|
6
6
|
if (predicate === void 0) { predicate = identity; }
|
|
7
7
|
var result = [[], []];
|
|
8
8
|
var internalIteratee = createIteratee(predicate);
|
|
@@ -10,6 +10,7 @@ function partition(collection, predicate) {
|
|
|
10
10
|
result[internalIteratee(item) ? 0 : 1].push(item);
|
|
11
11
|
});
|
|
12
12
|
return result;
|
|
13
|
-
}
|
|
13
|
+
};
|
|
14
|
+
var partition$1 = partition;
|
|
14
15
|
|
|
15
|
-
export { partition as default };
|
|
16
|
+
export { partition$1 as default };
|
package/es/range.js
CHANGED
|
@@ -2,7 +2,7 @@ import { mathMax, mathCeil } from './internals/native.js';
|
|
|
2
2
|
import isNil from './isNil.js';
|
|
3
3
|
import toFinite from './toFinite.js';
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
var range = function (start, end, step) {
|
|
6
6
|
start = toFinite(start);
|
|
7
7
|
if (isNil(end)) {
|
|
8
8
|
end = start;
|
|
@@ -23,6 +23,7 @@ function range(start, end, step) {
|
|
|
23
23
|
start += step;
|
|
24
24
|
}
|
|
25
25
|
return result;
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
|
+
var range$1 = range;
|
|
27
28
|
|
|
28
|
-
export { range as default };
|
|
29
|
+
export { range$1 as default };
|
package/es/some.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import forEach from './forEach.js';
|
|
2
2
|
import identity from './identity.js';
|
|
3
3
|
|
|
4
|
-
function
|
|
4
|
+
var some = function (collection, predicate) {
|
|
5
5
|
if (predicate === void 0) { predicate = identity; }
|
|
6
6
|
var result = false;
|
|
7
7
|
forEach(collection, function (item, index, arr) {
|
|
@@ -11,6 +11,7 @@ function some(collection, predicate) {
|
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
return result;
|
|
14
|
-
}
|
|
14
|
+
};
|
|
15
|
+
var some$1 = some;
|
|
15
16
|
|
|
16
|
-
export { some as default };
|
|
17
|
+
export { some$1 as default };
|
package/es/times.js
CHANGED
|
@@ -3,7 +3,7 @@ import { MAX_SAFE_INTEGER, mathMin, mathFloor, MAX_ARRAY_LENGTH } from './intern
|
|
|
3
3
|
import isInteger from './isInteger.js';
|
|
4
4
|
import isFinite from './isFinite.js';
|
|
5
5
|
|
|
6
|
-
function
|
|
6
|
+
var times = function (n, iteratee) {
|
|
7
7
|
if (iteratee === void 0) { iteratee = identity; }
|
|
8
8
|
if (n < 1 || n > MAX_SAFE_INTEGER) {
|
|
9
9
|
return [];
|
|
@@ -17,6 +17,7 @@ function times(n, iteratee) {
|
|
|
17
17
|
index++;
|
|
18
18
|
}
|
|
19
19
|
return result;
|
|
20
|
-
}
|
|
20
|
+
};
|
|
21
|
+
var times$1 = times;
|
|
21
22
|
|
|
22
|
-
export { times as default };
|
|
23
|
+
export { times$1 as default };
|
package/lib/clamp.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var defaultTo = require('./defaultTo.js');
|
|
4
4
|
var toNumber = require('./toNumber.js');
|
|
5
5
|
|
|
6
|
-
function
|
|
6
|
+
var clamp = function (number, lower, upper) {
|
|
7
7
|
if (upper === undefined) {
|
|
8
8
|
upper = lower;
|
|
9
9
|
lower = undefined;
|
|
@@ -24,6 +24,7 @@ function clamp(number, lower, upper) {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
return number;
|
|
27
|
-
}
|
|
27
|
+
};
|
|
28
|
+
var clamp$1 = clamp;
|
|
28
29
|
|
|
29
|
-
module.exports = clamp;
|
|
30
|
+
module.exports = clamp$1;
|
package/lib/conformsTo.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var allKeys = require('./allKeys.js');
|
|
4
4
|
var isNil = require('./isNil.js');
|
|
5
5
|
|
|
6
|
-
function
|
|
6
|
+
var conformsTo = function (object, source) {
|
|
7
7
|
var props = allKeys(source);
|
|
8
8
|
var length = props.length;
|
|
9
9
|
if (isNil(object)) {
|
|
@@ -21,6 +21,7 @@ function conformsTo(object, source) {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
return true;
|
|
24
|
-
}
|
|
24
|
+
};
|
|
25
|
+
var conformsTo$1 = conformsTo;
|
|
25
26
|
|
|
26
|
-
module.exports = conformsTo;
|
|
27
|
+
module.exports = conformsTo$1;
|
package/lib/countBy.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var forEach = require('./forEach.js');
|
|
4
4
|
var createIteratee = require('./internals/createIteratee.js');
|
|
5
5
|
|
|
6
|
-
function
|
|
6
|
+
var countBy = function (collection, iteratee) {
|
|
7
7
|
var result = {};
|
|
8
8
|
var internalIteratee = createIteratee(iteratee);
|
|
9
9
|
forEach(collection, function (item) {
|
|
@@ -16,6 +16,7 @@ function countBy(collection, iteratee) {
|
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
return result;
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
|
+
var countBy$1 = countBy;
|
|
20
21
|
|
|
21
|
-
module.exports = countBy;
|
|
22
|
+
module.exports = countBy$1;
|
package/lib/defaultTo.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
var defaultTo = function (value, defaultValue) {
|
|
4
4
|
return value == null || value !== value ? defaultValue : value;
|
|
5
|
-
}
|
|
5
|
+
};
|
|
6
|
+
var defaultTo$1 = defaultTo;
|
|
6
7
|
|
|
7
|
-
module.exports = defaultTo;
|
|
8
|
+
module.exports = defaultTo$1;
|
package/lib/every.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var forEach = require('./forEach.js');
|
|
4
4
|
var identity = require('./identity.js');
|
|
5
5
|
|
|
6
|
-
function
|
|
6
|
+
var every = function (collection, predicate) {
|
|
7
7
|
if (predicate === void 0) { predicate = identity; }
|
|
8
8
|
var result = true;
|
|
9
9
|
forEach(collection, function (item, index, arr) {
|
|
@@ -13,6 +13,7 @@ function every(collection, predicate) {
|
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
return result;
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
|
+
var every$1 = every;
|
|
17
18
|
|
|
18
|
-
module.exports = every;
|
|
19
|
+
module.exports = every$1;
|
package/lib/filter.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var forEach = require('./forEach.js');
|
|
4
4
|
var identity = require('./identity.js');
|
|
5
5
|
|
|
6
|
-
function
|
|
6
|
+
var filter = function (array, predicate) {
|
|
7
7
|
if (predicate === void 0) { predicate = identity; }
|
|
8
8
|
var results = [];
|
|
9
9
|
forEach(array, function (item, index) {
|
|
@@ -12,6 +12,7 @@ function filter(array, predicate) {
|
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
return results;
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
|
+
var filter$1 = filter;
|
|
16
17
|
|
|
17
|
-
module.exports = filter;
|
|
18
|
+
module.exports = filter$1;
|
package/lib/find.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var forEach = require('./forEach.js');
|
|
4
4
|
var identity = require('./identity.js');
|
|
5
5
|
|
|
6
|
-
function
|
|
6
|
+
var find = function (collection, predicate) {
|
|
7
7
|
if (predicate === void 0) { predicate = identity; }
|
|
8
8
|
var result;
|
|
9
9
|
forEach(collection, function (item, index, arr) {
|
|
@@ -13,6 +13,7 @@ function find(collection, predicate) {
|
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
return result;
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
|
+
var find$1 = find;
|
|
17
18
|
|
|
18
|
-
module.exports = find;
|
|
19
|
+
module.exports = find$1;
|
package/lib/fromPairs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var isArray = require('./isArray.js');
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
var fromPairs = function (array) {
|
|
6
6
|
var result = {};
|
|
7
7
|
if (!isArray(array)) {
|
|
8
8
|
return result;
|
|
@@ -11,6 +11,7 @@ function fromPairs(array) {
|
|
|
11
11
|
result[item[0]] = item[1];
|
|
12
12
|
});
|
|
13
13
|
return result;
|
|
14
|
-
}
|
|
14
|
+
};
|
|
15
|
+
var fromPairs$1 = fromPairs;
|
|
15
16
|
|
|
16
|
-
module.exports = fromPairs;
|
|
17
|
+
module.exports = fromPairs$1;
|
package/lib/groupBy.js
CHANGED
|
@@ -4,7 +4,7 @@ var forEach = require('./forEach.js');
|
|
|
4
4
|
var identity = require('./identity.js');
|
|
5
5
|
var createIteratee = require('./internals/createIteratee.js');
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
var groupBy = function (collection, iteratee) {
|
|
8
8
|
if (iteratee === void 0) { iteratee = identity; }
|
|
9
9
|
var result = {};
|
|
10
10
|
var internalIteratee = createIteratee(iteratee);
|
|
@@ -18,6 +18,7 @@ function groupBy(collection, iteratee) {
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
return result;
|
|
21
|
-
}
|
|
21
|
+
};
|
|
22
|
+
var groupBy$1 = groupBy;
|
|
22
23
|
|
|
23
|
-
module.exports = groupBy;
|
|
24
|
+
module.exports = groupBy$1;
|
package/lib/index.js
CHANGED
|
@@ -253,19 +253,19 @@ exports.toNumber = toNumber;
|
|
|
253
253
|
exports.toSafeInteger = toSafeInteger;
|
|
254
254
|
exports.toString = toString;
|
|
255
255
|
exports.uniqueId = uniqueId;
|
|
256
|
-
Object.defineProperty(exports,
|
|
256
|
+
Object.defineProperty(exports, "MAX_ARRAY_LENGTH", {
|
|
257
257
|
enumerable: true,
|
|
258
258
|
get: function () { return native.MAX_ARRAY_LENGTH; }
|
|
259
259
|
});
|
|
260
|
-
Object.defineProperty(exports,
|
|
260
|
+
Object.defineProperty(exports, "MAX_SAFE_INTEGER", {
|
|
261
261
|
enumerable: true,
|
|
262
262
|
get: function () { return native.MAX_SAFE_INTEGER; }
|
|
263
263
|
});
|
|
264
|
-
Object.defineProperty(exports,
|
|
264
|
+
Object.defineProperty(exports, "MIN_SAFE_INTEGER", {
|
|
265
265
|
enumerable: true,
|
|
266
266
|
get: function () { return native.MIN_SAFE_INTEGER; }
|
|
267
267
|
});
|
|
268
|
-
Object.defineProperty(exports,
|
|
268
|
+
Object.defineProperty(exports, "VERSION", {
|
|
269
269
|
enumerable: true,
|
|
270
270
|
get: function () { return helpers.VERSION; }
|
|
271
271
|
});
|
|
@@ -17,9 +17,7 @@ function baseDebounce(func, wait, immediate, __throttle__) {
|
|
|
17
17
|
}
|
|
18
18
|
var timeSinceLastCall = time - lastCallTime;
|
|
19
19
|
var timeSinceLastInvoke = time - lastInvokeTime;
|
|
20
|
-
return
|
|
21
|
-
timeSinceLastCall < 0 ||
|
|
22
|
-
(__throttle__ && timeSinceLastInvoke >= wait));
|
|
20
|
+
return timeSinceLastCall >= wait || timeSinceLastCall < 0 || (__throttle__ && timeSinceLastInvoke >= wait);
|
|
23
21
|
}
|
|
24
22
|
function invokeFunc(time) {
|
|
25
23
|
lastInvokeTime = time;
|
|
@@ -36,11 +34,7 @@ function baseDebounce(func, wait, immediate, __throttle__) {
|
|
|
36
34
|
lastArgs = args;
|
|
37
35
|
var time = Date.now();
|
|
38
36
|
var isInvoke = shouldInvoke(time);
|
|
39
|
-
var waitTime = !__throttle__
|
|
40
|
-
? wait
|
|
41
|
-
: !isInvoke && lastCallTime !== undefined && timer === undefined
|
|
42
|
-
? wait - (time - lastCallTime)
|
|
43
|
-
: wait;
|
|
37
|
+
var waitTime = !__throttle__ ? wait : !isInvoke && lastCallTime !== undefined && timer === undefined ? wait - (time - lastCallTime) : wait;
|
|
44
38
|
lastCallTime = time;
|
|
45
39
|
if (isInvoke) {
|
|
46
40
|
if (immediate && timer === undefined) {
|
|
@@ -5,7 +5,7 @@ var isArrayLike = require('../isArrayLike.js');
|
|
|
5
5
|
var keys = require('../keys.js');
|
|
6
6
|
|
|
7
7
|
function createForEach(dir) {
|
|
8
|
-
function
|
|
8
|
+
var forEach = function (collection, iteratee) {
|
|
9
9
|
if (iteratee === void 0) { iteratee = identity; }
|
|
10
10
|
var _keys = !isArrayLike(collection) && keys(collection);
|
|
11
11
|
var len = (_keys || collection).length;
|
|
@@ -18,7 +18,7 @@ function createForEach(dir) {
|
|
|
18
18
|
i += dir;
|
|
19
19
|
}
|
|
20
20
|
return collection;
|
|
21
|
-
}
|
|
21
|
+
};
|
|
22
22
|
return forEach;
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -20,11 +20,11 @@ function createReduce(dir) {
|
|
|
20
20
|
}
|
|
21
21
|
return memo;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
var reduce = function (collection, iteratee, initialValue) {
|
|
24
24
|
if (iteratee === void 0) { iteratee = identity; }
|
|
25
25
|
var initial = arguments.length >= 3;
|
|
26
26
|
return reducer(collection, iteratee, initialValue, initial);
|
|
27
|
-
}
|
|
27
|
+
};
|
|
28
28
|
return reduce;
|
|
29
29
|
}
|
|
30
30
|
|