mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
react app
This commit is contained in:
33
react-app/node_modules/lodash/internal/createExtremum.js
generated
vendored
Normal file
33
react-app/node_modules/lodash/internal/createExtremum.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
var arrayExtremum = require('./arrayExtremum'),
|
||||
baseCallback = require('./baseCallback'),
|
||||
baseExtremum = require('./baseExtremum'),
|
||||
isArray = require('../lang/isArray'),
|
||||
isIterateeCall = require('./isIterateeCall'),
|
||||
toIterable = require('./toIterable');
|
||||
|
||||
/**
|
||||
* Creates a `_.max` or `_.min` function.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} comparator The function used to compare values.
|
||||
* @param {*} exValue The initial extremum value.
|
||||
* @returns {Function} Returns the new extremum function.
|
||||
*/
|
||||
function createExtremum(comparator, exValue) {
|
||||
return function(collection, iteratee, thisArg) {
|
||||
if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
|
||||
iteratee = undefined;
|
||||
}
|
||||
iteratee = baseCallback(iteratee, thisArg, 3);
|
||||
if (iteratee.length == 1) {
|
||||
collection = isArray(collection) ? collection : toIterable(collection);
|
||||
var result = arrayExtremum(collection, iteratee, comparator, exValue);
|
||||
if (!(collection.length && result === exValue)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return baseExtremum(collection, iteratee, comparator, exValue);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = createExtremum;
|
Reference in New Issue
Block a user