diff --git a/README.md b/README.md index 700f7130e..4cf3cb1a1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# lodash v3.3.2 +# lodash v3.3.3 The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method. diff --git a/lodash.callback/README.md b/lodash.callback/README.md index 2647891d0..20f1b95da 100644 --- a/lodash.callback/README.md +++ b/lodash.callback/README.md @@ -1,4 +1,4 @@ -# lodash.callback v3.3.2 +# lodash.callback v3.3.3 The [lodash](https://lodash.com/) method `_.callback` exported as a [Node.js](https://nodejs.org/) module. @@ -21,4 +21,4 @@ In Node.js/io.js: var callback = require('lodash.callback'); ``` -See the [documentation](https://lodash.com/docs#callback) or [package source](https://github.com/lodash/lodash/blob/3.3.2-npm-packages/lodash.callback) for more details. +See the [documentation](https://lodash.com/docs#callback) or [package source](https://github.com/lodash/lodash/blob/3.3.3-npm-packages/lodash.callback) for more details. diff --git a/lodash.callback/index.js b/lodash.callback/index.js index b564780c4..2740e663f 100644 --- a/lodash.callback/index.js +++ b/lodash.callback/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.3.2 (Custom Build) + * lodash 3.3.3 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.3 diff --git a/lodash.callback/package.json b/lodash.callback/package.json index e224d43ca..40430f2ab 100644 --- a/lodash.callback/package.json +++ b/lodash.callback/package.json @@ -1,17 +1,14 @@ { "name": "lodash.callback", - "version": "3.3.2", - "description": "The modern build of lodash’s `_.callback` as a module.", + "version": "3.3.3", + "description": "The lodash method `_.callback` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", "author": "John-David Dalton (http://allyoucanleet.com/)", "contributors": [ "John-David Dalton (http://allyoucanleet.com/)", - "Benjamin Tan (https://d10.github.io/)", - "Blaine Bublitz (http://www.iceddev.com/)", - "Kit Cambridge (http://kitcambridge.be/)", + "Blaine Bublitz (https://github.com/phated)", "Mathias Bynens (https://mathiasbynens.be/)" ], "repository": "lodash/lodash", diff --git a/lodash.fill/README.md b/lodash.fill/README.md index cffc4824f..96d899825 100644 --- a/lodash.fill/README.md +++ b/lodash.fill/README.md @@ -1,4 +1,4 @@ -# lodash.fill v3.3.2 +# lodash.fill v3.3.3 The [lodash](https://lodash.com/) method `_.fill` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var fill = require('lodash.fill'); ``` -See the [documentation](https://lodash.com/docs#fill) or [package source](https://github.com/lodash/lodash/blob/3.3.2-npm-packages/lodash.fill) for more details. +See the [documentation](https://lodash.com/docs#fill) or [package source](https://github.com/lodash/lodash/blob/3.3.3-npm-packages/lodash.fill) for more details. diff --git a/lodash.fill/index.js b/lodash.fill/index.js index 511e4f1a2..4b45614df 100644 --- a/lodash.fill/index.js +++ b/lodash.fill/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.3.2 (Custom Build) + * lodash 3.3.3 (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 @@ -256,8 +256,7 @@ function eq(value, other) { * // => false */ function isArrayLike(value) { - return value != null && - !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value)); + return value != null && isLength(getLength(value)) && !isFunction(value); } /** @@ -278,8 +277,8 @@ function isArrayLike(value) { */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array constructors, and - // PhantomJS 1.9 which returns 'function' for `NodeList` instances. + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } diff --git a/lodash.fill/package.json b/lodash.fill/package.json index 6ff732202..ce78040a1 100644 --- a/lodash.fill/package.json +++ b/lodash.fill/package.json @@ -1,6 +1,6 @@ { "name": "lodash.fill", - "version": "3.3.2", + "version": "3.3.3", "description": "The lodash method `_.fill` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -9,7 +9,7 @@ "author": "John-David Dalton (http://allyoucanleet.com/)", "contributors": [ "John-David Dalton (http://allyoucanleet.com/)", - "Blaine Bublitz (https://github.com/phated)", + "Blaine Bublitz (https://github.com/phated)", "Mathias Bynens (https://mathiasbynens.be/)" ], "repository": "lodash/lodash", diff --git a/lodash.inrange/README.md b/lodash.inrange/README.md index b5dedc074..2845ab8d0 100644 --- a/lodash.inrange/README.md +++ b/lodash.inrange/README.md @@ -1,4 +1,4 @@ -# lodash.inrange v3.3.2 +# lodash.inrange v3.3.3 The [lodash](https://lodash.com/) method `_.inRange` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var inRange = require('lodash.inrange'); ``` -See the [documentation](https://lodash.com/docs#inRange) or [package source](https://github.com/lodash/lodash/blob/3.3.2-npm-packages/lodash.inrange) for more details. +See the [documentation](https://lodash.com/docs#inRange) or [package source](https://github.com/lodash/lodash/blob/3.3.3-npm-packages/lodash.inrange) for more details. diff --git a/lodash.inrange/index.js b/lodash.inrange/index.js index e19565ea3..b2f6787c9 100644 --- a/lodash.inrange/index.js +++ b/lodash.inrange/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.3.2 (Custom Build) + * lodash 3.3.3 (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 @@ -7,21 +7,156 @@ * Available under MIT license */ -/* Native method references for those with the same name as other `lodash` methods. */ +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** 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; + +/* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max, nativeMin = Math.min; +/** + * The base implementation of `_.inRange` which doesn't coerce arguments to numbers. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ +function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ +function toNumber(value) { + if (isObject(value)) { + var other = isFunction(value.valueOf) ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + /** * Checks if `n` is between `start` and up to but not including, `end`. If - * `end` is not specified it is set to `start` with `start` then set to `0`. + * `end` is not specified it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. * * @static * @memberOf _ * @category Number - * @param {number} n The number to check. + * @param {number} number The number to check. * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `n` is in the range, else `false`. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. * @example * * _.inRange(3, 2, 4); @@ -41,16 +176,20 @@ var nativeMax = Math.max, * * _.inRange(5.2, 4); * // => false + * + * _.inRange(-3, -2, -6); + * // => true */ -function inRange(value, start, end) { - start = +start || 0; +function inRange(number, start, end) { + start = toNumber(start) || 0; if (end === undefined) { end = start; start = 0; } else { - end = +end || 0; + end = toNumber(end) || 0; } - return value >= nativeMin(start, end) && value < nativeMax(start, end); + number = toNumber(number); + return baseInRange(number, start, end); } module.exports = inRange; diff --git a/lodash.inrange/package.json b/lodash.inrange/package.json index fac5b8415..d2280e73c 100644 --- a/lodash.inrange/package.json +++ b/lodash.inrange/package.json @@ -1,11 +1,11 @@ { "name": "lodash.inrange", - "version": "3.3.2", + "version": "3.3.3", "description": "The lodash method `_.inRange` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util, inrange", + "keywords": "lodash-modularized, inrange", "author": "John-David Dalton (http://allyoucanleet.com/)", "contributors": [ "John-David Dalton (http://allyoucanleet.com/)",