lodash.sortedindex
Advanced tools
Comparing version 4.0.2 to 4.0.3
84
index.js
/** | ||
* lodash 4.0.2 (Custom Build) <https://lodash.com/> | ||
* lodash (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
* Copyright jQuery Foundation and other contributors <https://jquery.org/> | ||
* Released under MIT license <https://lodash.com/license> | ||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
* Available under MIT license <https://lodash.com/license> | ||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
*/ | ||
@@ -15,3 +15,16 @@ var baseSortedIndexBy = require('lodash._basesortedindexby'); | ||
/** `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 `_.sortedIndex` and `_.sortedLastIndex` which | ||
@@ -37,3 +50,4 @@ * performs a binary search of `array` to determine the index at which `value` | ||
if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) { | ||
if (computed !== null && !isSymbol(computed) && | ||
(retHighest ? (computed <= value) : (computed < value))) { | ||
low = mid + 1; | ||
@@ -50,11 +64,13 @@ } else { | ||
/** | ||
* Uses a binary search to determine the lowest index at which `value` should | ||
* be inserted into `array` in order to maintain its sort order. | ||
* Uses a binary search to determine the lowest index at which `value` | ||
* should be inserted into `array` in order to maintain its sort order. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @category Array | ||
* @param {Array} array The sorted array to inspect. | ||
* @param {*} value The value to evaluate. | ||
* @returns {number} Returns the index at which `value` should be inserted into `array`. | ||
* @returns {number} Returns the index at which `value` should be inserted | ||
* into `array`. | ||
* @example | ||
@@ -73,5 +89,57 @@ * | ||
/** | ||
* 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 | ||
* | ||
* _.isObjectLike({}); | ||
* // => true | ||
* | ||
* _.isObjectLike([1, 2, 3]); | ||
* // => true | ||
* | ||
* _.isObjectLike(_.noop); | ||
* // => false | ||
* | ||
* _.isObjectLike(null); | ||
* // => false | ||
*/ | ||
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 returns the first argument given to it. | ||
* | ||
* @static | ||
* @since 0.1.0 | ||
* @memberOf _ | ||
@@ -78,0 +146,0 @@ * @category Util |
{ | ||
"name": "lodash.sortedindex", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "The lodash method `_.sortedIndex` exported as a module.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://lodash.com/", |
@@ -1,2 +0,2 @@ | ||
# lodash.sortedindex v4.0.2 | ||
# lodash.sortedindex v4.0.3 | ||
@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.sortedIndex` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [documentation](https://lodash.com/docs#sortedIndex) or [package source](https://github.com/lodash/lodash/blob/4.0.2-npm-packages/lodash.sortedindex) for more details. | ||
See the [documentation](https://lodash.com/docs#sortedIndex) or [package source](https://github.com/lodash/lodash/blob/4.0.3-npm-packages/lodash.sortedindex) for more details. |
Sorry, the diff of this file is not supported yet
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
Mixed license
License(Experimental) Package contains multiple licenses.
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
7352
144
1