lodash.maxby
Advanced tools
Comparing version 4.3.0 to 4.4.0
77
index.js
/** | ||
* lodash 4.3.0 (Custom Build) <https://lodash.com/> | ||
* lodash (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
@@ -11,3 +11,16 @@ * Copyright jQuery Foundation and other contributors <https://jquery.org/> | ||
/** `Object#toString` result references. */ | ||
var symbolTag = '[object Symbol]'; | ||
/** Used for built-in method references. */ | ||
var objectProto = Object.prototype; | ||
/** | ||
* Used to resolve the | ||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) | ||
* of values. | ||
*/ | ||
var objectToString = objectProto.toString; | ||
/** | ||
* The base implementation of methods like `_.max` and `_.min` which accepts a | ||
@@ -31,3 +44,3 @@ * `comparator` to determine the extremum value. | ||
if (current != null && (computed === undefined | ||
? current === current | ||
? (current === current && !isSymbol(current)) | ||
: comparator(current, computed) | ||
@@ -43,8 +56,5 @@ )) { | ||
/** | ||
* Checks if `value` is greater than `other`. | ||
* The base implementation of `_.gt` which doesn't coerce arguments to numbers. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 3.9.0 | ||
* @category Lang | ||
* @private | ||
* @param {*} value The value to compare. | ||
@@ -54,18 +64,59 @@ * @param {*} other The other value to compare. | ||
* else `false`. | ||
*/ | ||
function baseGt(value, other) { | ||
return value > other; | ||
} | ||
/** | ||
* Checks if `value` is object-like. A value is object-like if it's not `null` | ||
* and has a `typeof` result of "object". | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is object-like, else `false`. | ||
* @example | ||
* | ||
* _.gt(3, 1); | ||
* _.isObjectLike({}); | ||
* // => true | ||
* | ||
* _.gt(3, 3); | ||
* _.isObjectLike([1, 2, 3]); | ||
* // => true | ||
* | ||
* _.isObjectLike(_.noop); | ||
* // => false | ||
* | ||
* _.gt(1, 3); | ||
* _.isObjectLike(null); | ||
* // => false | ||
*/ | ||
function gt(value, other) { | ||
return value > other; | ||
function isObjectLike(value) { | ||
return !!value && typeof value == 'object'; | ||
} | ||
/** | ||
* Checks if `value` is classified as a `Symbol` primitive or object. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, | ||
* else `false`. | ||
* @example | ||
* | ||
* _.isSymbol(Symbol.iterator); | ||
* // => true | ||
* | ||
* _.isSymbol('abc'); | ||
* // => false | ||
*/ | ||
function isSymbol(value) { | ||
return typeof value == 'symbol' || | ||
(isObjectLike(value) && objectToString.call(value) == symbolTag); | ||
} | ||
/** | ||
* This method is like `_.max` except that it accepts `iteratee` which is | ||
@@ -96,3 +147,3 @@ * invoked for each element in `array` to generate the criterion by which | ||
return (array && array.length) | ||
? baseExtremum(array, baseIteratee(iteratee), gt) | ||
? baseExtremum(array, baseIteratee(iteratee), baseGt) | ||
: undefined; | ||
@@ -99,0 +150,0 @@ } |
{ | ||
"name": "lodash.maxby", | ||
"version": "4.3.0", | ||
"version": "4.4.0", | ||
"description": "The lodash method `_.maxBy` exported as a module.", | ||
@@ -18,4 +18,4 @@ "homepage": "https://lodash.com/", | ||
"dependencies": { | ||
"lodash._baseiteratee": "~4.6.0" | ||
"lodash._baseiteratee": "~4.7.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# lodash.maxby v4.3.0 | ||
# lodash.maxby v4.4.0 | ||
@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.maxBy` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [documentation](https://lodash.com/docs#maxBy) or [package source](https://github.com/lodash/lodash/blob/4.3.0-npm-packages/lodash.maxby) for more details. | ||
See the [documentation](https://lodash.com/docs#maxBy) or [package source](https://github.com/lodash/lodash/blob/4.4.0-npm-packages/lodash.maxby) for more details. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7123
136
+ Addedlodash._baseiteratee@4.7.0(transitive)
+ Addedlodash._basetostring@4.12.0(transitive)
+ Addedlodash._stringtopath@4.8.0(transitive)
- Removedlodash._baseiteratee@4.6.1(transitive)
- Removedlodash._stringtopath@4.7.1(transitive)
Updatedlodash._baseiteratee@~4.7.0