diff --git a/README.md b/README.md index 984ad5cab..0156d25c1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# lodash v3.0.9 +# lodash v3.1.0 The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method. diff --git a/lodash._baseassign/README.md b/lodash._baseassign/README.md index c4e1e5cdf..708412488 100644 --- a/lodash._baseassign/README.md +++ b/lodash._baseassign/README.md @@ -1,4 +1,4 @@ -# lodash._baseassign v3.0.2 +# lodash._baseassign v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseAssign` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var baseAssign = require('lodash._baseassign'); ``` -See the [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash._baseassign) for more details. +See the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._baseassign) for more details. diff --git a/lodash._baseassign/index.js b/lodash._baseassign/index.js index c4879d506..d0e14f3ea 100644 --- a/lodash._baseassign/index.js +++ b/lodash._baseassign/index.js @@ -1,43 +1,119 @@ /** - * lodash 3.0.2 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.2 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseCopy = require('lodash._basecopy'), + isNative = require('lodash.isnative'), keys = require('lodash.keys'); +/** Native method references. */ +var getOwnPropertySymbols = isNative(getOwnPropertySymbols = Object.getOwnPropertySymbols) && getOwnPropertySymbols, + preventExtensions = isNative(Object.preventExtensions = Object.preventExtensions) && preventExtensions; + +/** Used as `baseAssign`. */ +var nativeAssign = (function() { + // Avoid `Object.assign` in Firefox 34-37 which have an early implementation + // with a now defunct try/catch behavior. See https://bugzilla.mozilla.org/show_bug.cgi?id=1103344 + // for more details. + // + // Use `Object.preventExtensions` on a plain object instead of simply using + // `Object('x')` because Chrome and IE fail to throw an error when attempting + // to assign values to readonly indexes of strings in strict mode. + var object = { '1': 0 }, + func = preventExtensions && isNative(func = Object.assign) && func; + + try { func(preventExtensions(object), 'xo'); } catch(e) {} + return !object[1] && func; +}()); + /** * The base implementation of `_.assign` without support for argument juggling, - * multiple sources, and `this` binding `customizer` functions. + * multiple sources, and `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. - * @param {Function} [customizer] The function to customize assigning values. - * @returns {Object} Returns the destination object. + * @returns {Object} Returns `object`. */ -function baseAssign(object, source, customizer) { - var props = keys(source); - if (!customizer) { - return baseCopy(source, object, props); - } - var index = -1, - length = props.length; +var baseAssign = nativeAssign || function(object, source) { + return source == null + ? object + : baseCopy(source, getSymbols(source), baseCopy(source, keys(source), object)); +}; - while (++index < length) { - var key = props[index], - value = object[key], - result = customizer(value, source[key], key, object, source); +/** + * Creates an array of the own symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !getOwnPropertySymbols ? constant([]) : function(object) { + return getOwnPropertySymbols(toObject(object)); +}; - if ((result === result ? (result !== value) : (value === value)) || - (typeof value == 'undefined' && !(key in object))) { - object[key] = result; - } - } - return object; +/** + * Converts `value` to an object if it is not one. + * + * @private + * @param {*} value The value to process. + * @returns {Object} Returns the object. + */ +function toObject(value) { + return isObject(value) ? value : Object(value); +} + +/** + * 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(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return type == 'function' || (!!value && type == 'object'); +} + +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @category Utility + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new function. + * @example + * + * var object = { 'user': 'fred' }; + * var getter = _.constant(object); + * + * getter() === object; + * // => true + */ +function constant(value) { + return function() { + return value; + }; } module.exports = baseAssign; diff --git a/lodash._baseassign/package.json b/lodash._baseassign/package.json index 8da2a58a4..e2e4d9686 100644 --- a/lodash._baseassign/package.json +++ b/lodash._baseassign/package.json @@ -1,6 +1,6 @@ { "name": "lodash._baseassign", - "version": "3.0.2", + "version": "3.1.0", "description": "The modern build of lodash’s internal `baseAssign` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,7 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._basecopy": "^3.0.0", + "lodash.isnative": "^3.0.0", "lodash.keys": "^3.0.0" } } diff --git a/lodash._basecallback/README.md b/lodash._basecallback/README.md index abcae4a0c..494c757ba 100644 --- a/lodash._basecallback/README.md +++ b/lodash._basecallback/README.md @@ -1,4 +1,4 @@ -# lodash._basecallback v3.0.1 +# lodash._basecallback v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseCallback` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var baseCallback = require('lodash._basecallback'); ``` -See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._basecallback) for more details. +See the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._basecallback) for more details. diff --git a/lodash._basecallback/index.js b/lodash._basecallback/index.js index 2a6b2c378..59e124fef 100644 --- a/lodash._basecallback/index.js +++ b/lodash._basecallback/index.js @@ -1,22 +1,14 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.7.0 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseClone = require('lodash._baseclone'), - baseIsEqual = require('lodash._baseisequal'), +var baseMatches = require('lodash._basematches'), baseProperty = require('lodash._baseproperty'), - bindCallback = require('lodash._bindcallback'), - keys = require('lodash.keys'); - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + bindCallback = require('lodash._bindcallback'); /** * The base implementation of `_.callback` which supports specifying the @@ -40,139 +32,10 @@ function baseCallback(func, thisArg, argCount) { } // Handle "_.property" and "_.matches" style callback shorthands. return type == 'object' - ? baseMatches(func, !argCount) + ? baseMatches(func) : baseProperty(func + ''); } -/** - * The base implementation of `_.isMatch` without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Object} source The object to inspect. - * @param {Array} props The source property names to match. - * @param {Array} values The source values to match. - * @param {Array} strictCompareFlags Strict comparison flags for source values. - * @param {Function} [customizer] The function to customize comparing objects. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ -function baseIsMatch(object, props, values, strictCompareFlags, customizer) { - var length = props.length; - if (object == null) { - return !length; - } - var index = -1, - noCustomizer = !customizer; - - while (++index < length) { - if ((noCustomizer && strictCompareFlags[index]) - ? values[index] !== object[props[index]] - : !hasOwnProperty.call(object, props[index]) - ) { - return false; - } - } - index = -1; - while (++index < length) { - var key = props[index]; - if (noCustomizer && strictCompareFlags[index]) { - var result = hasOwnProperty.call(object, key); - } else { - var objValue = object[key], - srcValue = values[index]; - - result = customizer ? customizer(objValue, srcValue, key) : undefined; - if (typeof result == 'undefined') { - result = baseIsEqual(srcValue, objValue, customizer, true); - } - } - if (!result) { - return false; - } - } - return true; -} - -/** - * The base implementation of `_.matches` which supports specifying whether - * `source` should be cloned. - * - * @private - * @param {Object} source The object of property values to match. - * @param {boolean} [isCloned] Specify cloning the source object. - * @returns {Function} Returns the new function. - */ -function baseMatches(source, isCloned) { - var props = keys(source), - length = props.length; - - if (length == 1) { - var key = props[0], - value = source[key]; - - if (isStrictComparable(value)) { - return function(object) { - return object != null && value === object[key] && hasOwnProperty.call(object, key); - }; - } - } - if (isCloned) { - source = baseClone(source, true); - } - var values = Array(length), - strictCompareFlags = Array(length); - - while (length--) { - value = source[props[length]]; - values[length] = value; - strictCompareFlags[length] = isStrictComparable(value); - } - return function(object) { - return baseIsMatch(object, props, values, strictCompareFlags); - }; -} - -/** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ -function isStrictComparable(value) { - return value === value && (value === 0 ? ((1 / value) > 0) : !isObject(value)); -} - -/** - * Checks if `value` is the language type of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * **Note:** See the [ES5 spec](https://es5.github.io/#x8) for more details. - * - * @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(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return type == 'function' || (value && type == 'object') || false; -} - /** * This method returns the first argument provided to it. * diff --git a/lodash._basecallback/package.json b/lodash._basecallback/package.json index 3c106310e..140bf0049 100644 --- a/lodash._basecallback/package.json +++ b/lodash._basecallback/package.json @@ -1,6 +1,6 @@ { "name": "lodash._basecallback", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s internal `baseCallback` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -16,10 +16,8 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._baseclone": "^3.0.0", - "lodash._baseisequal": "^3.0.0", + "lodash._basematches": "^3.0.0", "lodash._baseproperty": "^3.0.0", - "lodash._bindcallback": "^3.0.0", - "lodash.keys": "^3.0.0" + "lodash._bindcallback": "^3.0.0" } } diff --git a/lodash._baseclone/README.md b/lodash._baseclone/README.md index 2f89b1473..20acdb866 100644 --- a/lodash._baseclone/README.md +++ b/lodash._baseclone/README.md @@ -1,4 +1,4 @@ -# lodash._baseclone v3.0.1 +# lodash._baseclone v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseClone` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var baseClone = require('lodash._baseclone'); ``` -See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._baseclone) for more details. +See the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._baseclone) for more details. diff --git a/lodash._baseclone/index.js b/lodash._baseclone/index.js index 7ffadc4c7..a77e8c2ea 100644 --- a/lodash._baseclone/index.js +++ b/lodash._baseclone/index.js @@ -1,14 +1,14 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.2 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var arrayCopy = require('lodash._arraycopy'), arrayEach = require('lodash._arrayeach'), - baseCopy = require('lodash._basecopy'), + baseAssign = require('lodash._baseassign'), baseFor = require('lodash._basefor'), isArray = require('lodash.isarray'), isNative = require('lodash.isnative'), @@ -110,7 +110,7 @@ function baseClone(value, isDeep, customizer, key, object, stackA, stackB) { if (customizer) { result = object ? customizer(value, key, object) : customizer(value); } - if (typeof result != 'undefined') { + if (result !== undefined) { return result; } if (!isObject(value)) { @@ -129,7 +129,7 @@ function baseClone(value, isDeep, customizer, key, object, stackA, stackB) { if (tag == objectTag || tag == argsTag || (isFunc && !object)) { result = initCloneObject(isFunc ? {} : value); if (!isDeep) { - return baseCopy(value, result, keys(value)); + return baseAssign(result, value); } } else { return cloneableTags[tag] @@ -241,7 +241,6 @@ function initCloneObject(object) { * **Note:** This function only supports cloning values with tags of * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. * - * * @private * @param {Object} object The object to clone. * @param {string} tag The `toStringTag` of the object to clone. diff --git a/lodash._baseclone/package.json b/lodash._baseclone/package.json index ad7d45694..8799ded64 100644 --- a/lodash._baseclone/package.json +++ b/lodash._baseclone/package.json @@ -1,6 +1,6 @@ { "name": "lodash._baseclone", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s internal `baseClone` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,7 +18,7 @@ "dependencies": { "lodash._arraycopy": "^3.0.0", "lodash._arrayeach": "^3.0.0", - "lodash._basecopy": "^3.0.0", + "lodash._baseassign": "^3.0.0", "lodash._basefor": "^3.0.0", "lodash.isarray": "^3.0.0", "lodash.isnative": "^3.0.0", diff --git a/lodash._basedelay/LICENSE.txt b/lodash._basedelay/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash._basedelay/LICENSE.txt +++ b/lodash._basedelay/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash._basedelay/README.md b/lodash._basedelay/README.md index 96a52e1b7..a83cfd95b 100644 --- a/lodash._basedelay/README.md +++ b/lodash._basedelay/README.md @@ -1,4 +1,4 @@ -# lodash._basedelay v3.0.1 +# lodash._basedelay v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseDelay` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var baseDelay = require('lodash._basedelay'); ``` -See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._basedelay) for more details. +See the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._basedelay) for more details. diff --git a/lodash._basedelay/index.js b/lodash._basedelay/index.js index 61bc5a8ea..392e32323 100644 --- a/lodash._basedelay/index.js +++ b/lodash._basedelay/index.js @@ -1,12 +1,11 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseSlice = require('lodash._baseslice'); /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; @@ -18,14 +17,14 @@ var FUNC_ERROR_TEXT = 'Expected a function'; * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. - * @param {Object} args The `arguments` object to slice and provide to `func`. + * @param {Object} args The arguments provide to `func`. * @returns {number} Returns the timer id. */ -function baseDelay(func, wait, args, fromIndex) { +function baseDelay(func, wait, args) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } - return setTimeout(function() { func.apply(undefined, baseSlice(args, fromIndex)); }, wait); + return setTimeout(function() { func.apply(undefined, args); }, wait); } module.exports = baseDelay; diff --git a/lodash._basedelay/package.json b/lodash._basedelay/package.json index 95dd639f8..7ec6bfd8a 100644 --- a/lodash._basedelay/package.json +++ b/lodash._basedelay/package.json @@ -1,6 +1,6 @@ { "name": "lodash._basedelay", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s internal `baseDelay` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -14,8 +14,5 @@ "Mathias Bynens (https://mathiasbynens.be/)" ], "repository": "lodash/lodash", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "dependencies": { - "lodash._baseslice": "^3.0.0" - } + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } } diff --git a/lodash._baseflatten/README.md b/lodash._baseflatten/README.md index 45451e4a4..1c1a44565 100644 --- a/lodash._baseflatten/README.md +++ b/lodash._baseflatten/README.md @@ -1,4 +1,4 @@ -# lodash._baseflatten v3.0.1 +# lodash._baseflatten v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseFlatten` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var baseFlatten = require('lodash._baseflatten'); ``` -See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._baseflatten) for more details. +See the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._baseflatten) for more details. diff --git a/lodash._baseflatten/index.js b/lodash._baseflatten/index.js index d99dc0243..1eeab6c50 100644 --- a/lodash._baseflatten/index.js +++ b/lodash._baseflatten/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.2 @@ -33,13 +33,13 @@ var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; * * @private * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param {boolean} [isStrict] Restrict flattening to arrays and `arguments` objects. - * @param {number} [fromIndex=0] The index to start from. + * @param {boolean} isDeep Specify a deep flatten. + * @param {boolean} isStrict Restrict flattening to arrays and `arguments` objects. + * @param {number} fromIndex The index to start from. * @returns {Array} Returns the new flattened array. */ function baseFlatten(array, isDeep, isStrict, fromIndex) { - var index = fromIndex == null ? -1 : (fromIndex - 1), + var index = fromIndex - 1, length = array.length, resIndex = -1, result = []; @@ -50,7 +50,7 @@ function baseFlatten(array, isDeep, isStrict, fromIndex) { if (isObjectLike(value) && isLength(value.length) && (isArray(value) || isArguments(value))) { if (isDeep) { // Recursively flatten arrays (susceptible to call stack limits). - value = baseFlatten(value, isDeep, isStrict); + value = baseFlatten(value, isDeep, isStrict, 0); } var valIndex = -1, valLength = value.length; diff --git a/lodash._baseflatten/package.json b/lodash._baseflatten/package.json index d58c006de..0bced3237 100644 --- a/lodash._baseflatten/package.json +++ b/lodash._baseflatten/package.json @@ -1,6 +1,6 @@ { "name": "lodash._baseflatten", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s internal `baseFlatten` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", diff --git a/lodash._baseindexof/README.md b/lodash._baseindexof/README.md index a796bc0e5..ddcc79d5d 100644 --- a/lodash._baseindexof/README.md +++ b/lodash._baseindexof/README.md @@ -1,4 +1,4 @@ -# lodash._baseindexof v3.0.0 +# lodash._baseindexof v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseIndexOf` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var baseIndexOf = require('lodash._baseindexof'); ``` -See the [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash._baseindexof) for more details. +See the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._baseindexof) for more details. diff --git a/lodash._baseindexof/index.js b/lodash._baseindexof/index.js index 35383b26d..cfccf07c9 100644 --- a/lodash._baseindexof/index.js +++ b/lodash._baseindexof/index.js @@ -1,8 +1,8 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ @@ -13,14 +13,24 @@ * @private * @param {Array} array The array to search. * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + +/** + * The base implementation of `_.indexOf` without support for binary searches. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { if (value !== value) { return indexOfNaN(array, fromIndex); } - var index = (fromIndex || 0) - 1, + var index = fromIndex - 1, length = array.length; while (++index < length) { @@ -33,17 +43,16 @@ function baseIndexOf(array, value, fromIndex) { /** * Gets the index at which the first occurrence of `NaN` is found in `array`. - * If `fromRight` is provided elements of `array` are iterated from right to left. * * @private * @param {Array} array The array to search. - * @param {number} [fromIndex] The index to search from. + * @param {number} fromIndex The index to search from. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {number} Returns the index of the matched `NaN`, else `-1`. */ function indexOfNaN(array, fromIndex, fromRight) { var length = array.length, - index = fromRight ? (fromIndex || length) : ((fromIndex || 0) - 1); + index = fromIndex + (fromRight ? 0 : -1); while ((fromRight ? index-- : ++index < length)) { var other = array[index]; diff --git a/lodash._baseindexof/package.json b/lodash._baseindexof/package.json index e5bb73a19..59bd59574 100644 --- a/lodash._baseindexof/package.json +++ b/lodash._baseindexof/package.json @@ -1,6 +1,6 @@ { "name": "lodash._baseindexof", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s internal `baseIndexOf` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", diff --git a/lodash.capitalize/LICENSE.txt b/lodash._baseismatch/LICENSE.txt similarity index 100% rename from lodash.capitalize/LICENSE.txt rename to lodash._baseismatch/LICENSE.txt diff --git a/lodash._baseismatch/README.md b/lodash._baseismatch/README.md new file mode 100644 index 000000000..5afefee20 --- /dev/null +++ b/lodash._baseismatch/README.md @@ -0,0 +1,20 @@ +# lodash._baseismatch v3.1.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseIsMatch` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._baseismatch +``` + +In Node.js/io.js: + +```js +var baseIsMatch = require('lodash._baseismatch'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._baseismatch) for more details. diff --git a/lodash._baseismatch/index.js b/lodash._baseismatch/index.js new file mode 100644 index 000000000..27ad9db11 --- /dev/null +++ b/lodash._baseismatch/index.js @@ -0,0 +1,66 @@ +/** + * lodash 3.1.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.7.0 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var baseIsEqual = require('lodash._baseisequal'); + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.isMatch` without support for callback + * shorthands or `this` binding. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The source property names to match. + * @param {Array} values The source values to match. + * @param {Array} strictCompareFlags Strict comparison flags for source values. + * @param {Function} [customizer] The function to customize comparing objects. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, props, values, strictCompareFlags, customizer) { + var length = props.length; + if (object == null) { + return !length; + } + var index = -1, + noCustomizer = !customizer; + + while (++index < length) { + if ((noCustomizer && strictCompareFlags[index]) + ? values[index] !== object[props[index]] + : !hasOwnProperty.call(object, props[index]) + ) { + return false; + } + } + index = -1; + while (++index < length) { + var key = props[index]; + if (noCustomizer && strictCompareFlags[index]) { + var result = hasOwnProperty.call(object, key); + } else { + var objValue = object[key], + srcValue = values[index]; + + result = customizer ? customizer(objValue, srcValue, key) : undefined; + if (typeof result == 'undefined') { + result = baseIsEqual(srcValue, objValue, customizer, true); + } + } + if (!result) { + return false; + } + } + return true; +} + +module.exports = baseIsMatch; diff --git a/lodash._baseismatch/package.json b/lodash._baseismatch/package.json new file mode 100644 index 000000000..9eec87c04 --- /dev/null +++ b/lodash._baseismatch/package.json @@ -0,0 +1,21 @@ +{ + "name": "lodash._baseismatch", + "version": "3.1.0", + "description": "The modern build of lodash’s internal `baseIsMatch` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "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/)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, + "dependencies": { + "lodash._baseisequal": "^3.0.0" + } +} diff --git a/lodash.escape/LICENSE.txt b/lodash._basematches/LICENSE.txt similarity index 100% rename from lodash.escape/LICENSE.txt rename to lodash._basematches/LICENSE.txt diff --git a/lodash._basematches/README.md b/lodash._basematches/README.md new file mode 100644 index 000000000..6adb17217 --- /dev/null +++ b/lodash._basematches/README.md @@ -0,0 +1,20 @@ +# lodash._basematches v3.1.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseMatches` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._basematches +``` + +In Node.js/io.js: + +```js +var baseMatches = require('lodash._basematches'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._basematches) for more details. diff --git a/lodash._basematches/index.js b/lodash._basematches/index.js new file mode 100644 index 000000000..b2a2e8a5a --- /dev/null +++ b/lodash._basematches/index.js @@ -0,0 +1,143 @@ +/** + * lodash 3.1.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.7.0 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var baseIsEqual = require('lodash._baseisequal'), + keys = require('lodash.keys'); + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.isMatch` without support for callback + * shorthands or `this` binding. + * + * @private + * @param {Object} source The object to inspect. + * @param {Array} props The source property names to match. + * @param {Array} values The source values to match. + * @param {Array} strictCompareFlags Strict comparison flags for source values. + * @param {Function} [customizer] The function to customize comparing objects. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, props, values, strictCompareFlags, customizer) { + var length = props.length; + if (object == null) { + return !length; + } + var index = -1, + noCustomizer = !customizer; + + while (++index < length) { + if ((noCustomizer && strictCompareFlags[index]) + ? values[index] !== object[props[index]] + : !hasOwnProperty.call(object, props[index]) + ) { + return false; + } + } + index = -1; + while (++index < length) { + var key = props[index]; + if (noCustomizer && strictCompareFlags[index]) { + var result = hasOwnProperty.call(object, key); + } else { + var objValue = object[key], + srcValue = values[index]; + + result = customizer ? customizer(objValue, srcValue, key) : undefined; + if (typeof result == 'undefined') { + result = baseIsEqual(srcValue, objValue, customizer, true); + } + } + if (!result) { + return false; + } + } + return true; +} + +/** + * The base implementation of `_.matches` which supports specifying whether + * `source` should be cloned. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new function. + */ +function baseMatches(source) { + var props = keys(source), + length = props.length; + + if (length == 1) { + var key = props[0], + value = source[key]; + + if (isStrictComparable(value)) { + return function(object) { + return object != null && value === object[key] && hasOwnProperty.call(object, key); + }; + } + } + var values = Array(length), + strictCompareFlags = Array(length); + + while (length--) { + value = source[props[length]]; + values[length] = value; + strictCompareFlags[length] = isStrictComparable(value); + } + return function(object) { + return baseIsMatch(object, props, values, strictCompareFlags); + }; +} + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && (value === 0 ? ((1 / value) > 0) : !isObject(value)); +} + +/** + * Checks if `value` is the language type of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * **Note:** See the [ES5 spec](https://es5.github.io/#x8) for more details. + * + * @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(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return type == 'function' || (value && type == 'object') || false; +} + +module.exports = baseMatches; diff --git a/lodash._basematches/package.json b/lodash._basematches/package.json new file mode 100644 index 000000000..a02b69fe0 --- /dev/null +++ b/lodash._basematches/package.json @@ -0,0 +1,22 @@ +{ + "name": "lodash._basematches", + "version": "3.1.0", + "description": "The modern build of lodash’s internal `baseMatches` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "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/)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, + "dependencies": { + "lodash._baseisequal": "^3.0.0", + "lodash.keys": "^3.0.0" + } +} diff --git a/lodash._createassigner/LICENSE.txt b/lodash._createassigner/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash._createassigner/LICENSE.txt +++ b/lodash._createassigner/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash._createassigner/README.md b/lodash._createassigner/README.md index 1f8d4a153..c65eaf1e2 100644 --- a/lodash._createassigner/README.md +++ b/lodash._createassigner/README.md @@ -1,4 +1,4 @@ -# lodash._createassigner v3.0.1 +# lodash._createassigner v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createAssigner` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var createAssigner = require('lodash._createassigner'); ``` -See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._createassigner) for more details. +See the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._createassigner) for more details. diff --git a/lodash._createassigner/index.js b/lodash._createassigner/index.js index 37efe38a7..d21e708a0 100644 --- a/lodash._createassigner/index.js +++ b/lodash._createassigner/index.js @@ -1,13 +1,14 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.2 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var bindCallback = require('lodash._bindcallback'), - isIterateeCall = require('lodash._isiterateecall'); + isIterateeCall = require('lodash._isiterateecall'), + restParam = require('lodash.restparam'); /** * Creates a function that assigns properties of source object(s) to a given @@ -20,38 +21,32 @@ var bindCallback = require('lodash._bindcallback'), * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { - return function() { - var args = arguments, - length = args.length, - object = args[0]; + return restParam(function(object, sources) { + var index = -1, + length = object == null ? 0 : sources.length, + customizer = length > 2 && sources[length - 2], + guard = length > 2 && sources[2], + thisArg = length > 1 && sources[length - 1]; - if (length < 2 || object == null) { - return object; - } - var customizer = args[length - 2], - thisArg = args[length - 1], - guard = args[3]; - - if (length > 3 && typeof customizer == 'function') { + if (typeof customizer == 'function') { customizer = bindCallback(customizer, thisArg, 5); length -= 2; } else { - customizer = (length > 2 && typeof thisArg == 'function') ? thisArg : null; + customizer = typeof thisArg == 'function' ? thisArg : null; length -= (customizer ? 1 : 0); } - if (guard && isIterateeCall(args[1], args[2], guard)) { - customizer = length == 3 ? null : customizer; - length = 2; + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? null : customizer; + length = 1; } - var index = 0; while (++index < length) { - var source = args[index]; + var source = sources[index]; if (source) { assigner(object, source, customizer); } } return object; - }; + }); } module.exports = createAssigner; diff --git a/lodash._createassigner/package.json b/lodash._createassigner/package.json index f3ee309a9..cca0ff052 100644 --- a/lodash._createassigner/package.json +++ b/lodash._createassigner/package.json @@ -1,6 +1,6 @@ { "name": "lodash._createassigner", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s internal `createAssigner` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,7 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._bindcallback": "^3.0.0", - "lodash._isiterateecall": "^3.0.0" + "lodash._isiterateecall": "^3.0.0", + "lodash.restparam": "^3.0.0" } } diff --git a/lodash._createcache/README.md b/lodash._createcache/README.md index b37eb746b..8ce5dae08 100644 --- a/lodash._createcache/README.md +++ b/lodash._createcache/README.md @@ -1,4 +1,4 @@ -# lodash._createcache v3.0.1 +# lodash._createcache v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createCache` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var createCache = require('lodash._createcache'); ``` -See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._createcache) for more details. +See the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._createcache) for more details. diff --git a/lodash._createcache/index.js b/lodash._createcache/index.js index cbeb715d6..eba712d35 100644 --- a/lodash._createcache/index.js +++ b/lodash._createcache/index.js @@ -1,18 +1,18 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.2 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var isNative = require('lodash.isnative'); +var getNative = require('lodash._getnative'); /** Native method references. */ -var Set = isNative(Set = global.Set) && Set; +var Set = getNative(root, 'Set'); /* Native method references for those with the same name as other `lodash` methods. */ -var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate; +var nativeCreate = getNative(Object, 'create'); /** * @@ -82,7 +82,7 @@ function isObject(value) { // Avoid a V8 JIT bug in Chrome 19-20. // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; - return type == 'function' || (!!value && type == 'object'); + return !!value && (type == 'object' || type == 'function'); } /** diff --git a/lodash._createcache/package.json b/lodash._createcache/package.json index ab6b13e33..4e7abab42 100644 --- a/lodash._createcache/package.json +++ b/lodash._createcache/package.json @@ -1,6 +1,6 @@ { "name": "lodash._createcache", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s internal `createCache` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -16,6 +16,6 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash.isnative": "^3.0.0" + "lodash._getnative": "^3.0.0" } } diff --git a/lodash._createwrapper/LICENSE b/lodash._createwrapper/LICENSE index 9cd87e5dc..b054ca5a3 100644 --- a/lodash._createwrapper/LICENSE +++ b/lodash._createwrapper/LICENSE @@ -1,5 +1,5 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash._createwrapper/README.md b/lodash._createwrapper/README.md index 4a6a4dc37..488b6329b 100644 --- a/lodash._createwrapper/README.md +++ b/lodash._createwrapper/README.md @@ -1,20 +1,18 @@ -# lodash._createwrapper v3.0.7 +# lodash._createwrapper v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createWrapper` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The internal [lodash](https://lodash.com/) function `createWrapper` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash._createwrapper ``` -In Node.js/io.js: - +In Node.js: ```js var createWrapper = require('lodash._createwrapper'); ``` -See the [package source](https://github.com/lodash/lodash/blob/3.0.7-npm-packages/lodash._createwrapper) for more details. +See the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._createwrapper) for more details. diff --git a/lodash._createwrapper/index.js b/lodash._createwrapper/index.js index 158eb1111..311b5e64d 100644 --- a/lodash._createwrapper/index.js +++ b/lodash._createwrapper/index.js @@ -1,14 +1,11 @@ /** - * lodash 3.0.7 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var arrayCopy = require('lodash._arraycopy'), - baseCreate = require('lodash._basecreate'), - replaceHolders = require('lodash._replaceholders'); /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, @@ -18,23 +15,134 @@ var BIND_FLAG = 1, CURRY_RIGHT_FLAG = 16, PARTIAL_FLAG = 32, PARTIAL_RIGHT_FLAG = 64, - ARY_FLAG = 128; + ARY_FLAG = 128, + FLIP_FLAG = 512; /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; -/** Used to detect unsigned integer values. */ -var reIsUint = /^\d+$/; +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; -/* Native method references for those with the same name as other `lodash` methods. */ +/** Used as the internal argument placeholder. */ +var PLACEHOLDER = '__lodash_placeholder__'; + +/** `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; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Built-in method references without a dependency on `global`. */ +var freeParseInt = parseInt; + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + var length = args ? args.length : 0; + switch (length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; +} + +/** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ +function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = -1, + result = []; + + while (++index < length) { + if (array[index] === placeholder) { + array[index] = PLACEHOLDER; + result[++resIndex] = index; + } + } + return result; +} + +/** Used for built-in method references. */ +var objectProto = global.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; /** - * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) - * of an array-like value. + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. */ -var MAX_SAFE_INTEGER = 9007199254740991; +var baseCreate = (function() { + function object() {} + return function(prototype) { + if (isObject(prototype)) { + object.prototype = prototype; + var result = new object; + object.prototype = undefined; + } + return result || {}; + }; +}()); /** * Creates an array that is the composition of partially applied arguments, @@ -99,20 +207,41 @@ function composeArgsRight(args, partials, holders) { } /** - * Creates a function that wraps `func` and invokes it with the `this` + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +/** + * Creates a function that wraps `func` to invoke it with the optional `this` * binding of `thisArg`. * * @private - * @param {Function} func The function to bind. + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. * @param {*} [thisArg] The `this` binding of `func`. - * @returns {Function} Returns the new bound function. + * @returns {Function} Returns the new wrapped function. */ -function createBindWrapper(func, thisArg) { - var Ctor = createCtorWrapper(func); +function createBaseWrapper(func, bitmask, thisArg) { + var isBind = bitmask & BIND_FLAG, + Ctor = createCtorWrapper(func); function wrapper() { var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func; - return fn.apply(thisArg, arguments); + return fn.apply(isBind ? thisArg : this, arguments); } return wrapper; } @@ -151,12 +280,46 @@ function createCtorWrapper(Ctor) { } /** - * Creates a function that wraps `func` and invokes it with optional `this` - * binding of, partial application, and currying. + * Creates a function that wraps `func` to enable currying. * * @private - * @param {Function|string} func The function or method name to reference. - * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createCurryWrapper(func, bitmask, arity) { + var Ctor = createCtorWrapper(func); + + function wrapper() { + var length = arguments.length, + index = length, + args = Array(length), + fn = (this && this !== global && this instanceof wrapper) ? Ctor : func, + placeholder = wrapper.placeholder; + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + return length < arity + ? createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, undefined, args, holders, undefined, undefined, arity - length) + : apply(fn, this, args); + } + return wrapper; +} + +/** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to the new function. * @param {Array} [holders] The `partials` placeholder indexes. @@ -172,13 +335,11 @@ function createHybridWrapper(func, bitmask, thisArg, partials, holders, partials isBind = bitmask & BIND_FLAG, isBindKey = bitmask & BIND_KEY_FLAG, isCurry = bitmask & CURRY_FLAG, - isCurryBound = bitmask & CURRY_BOUND_FLAG, isCurryRight = bitmask & CURRY_RIGHT_FLAG, + isFlip = bitmask & FLIP_FLAG, Ctor = isBindKey ? undefined : createCtorWrapper(func); function wrapper() { - // Avoid `arguments` object use disqualifying optimizations by - // converting it to an array before providing it to other functions. var length = arguments.length, index = length, args = Array(length); @@ -198,23 +359,7 @@ function createHybridWrapper(func, bitmask, thisArg, partials, holders, partials length -= argsHolders.length; if (length < arity) { - var newArgPos = argPos ? arrayCopy(argPos) : undefined, - newArity = nativeMax(arity - length, 0), - newsHolders = isCurry ? argsHolders : undefined, - newHoldersRight = isCurry ? undefined : argsHolders, - newPartials = isCurry ? args : undefined, - newPartialsRight = isCurry ? undefined : args; - - bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG); - bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); - - if (!isCurryBound) { - bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); - } - var result = createHybridWrapper(func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity); - - result.placeholder = placeholder; - return result; + return createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, thisArg, args, argsHolders, argPos, ary, arity - length); } } var thisBinding = isBind ? thisArg : this, @@ -222,12 +367,14 @@ function createHybridWrapper(func, bitmask, thisArg, partials, holders, partials if (argPos) { args = reorder(args, argPos); + } else if (isFlip && args.length > 1) { + args.reverse(); } if (isAry && ary < args.length) { args.length = ary; } if (this && this !== global && this instanceof wrapper) { - fn = Ctor || createCtorWrapper(func); + fn = Ctor || createCtorWrapper(fn); } return fn.apply(thisBinding, args); } @@ -235,29 +382,28 @@ function createHybridWrapper(func, bitmask, thisArg, partials, holders, partials } /** - * Creates a function that wraps `func` and invokes it with the optional `this` + * Creates a function that wraps `func` to invoke it with the optional `this` * binding of `thisArg` and the `partials` prepended to those provided to * the wrapper. * * @private - * @param {Function} func The function to partially apply arguments to. - * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. * @param {*} thisArg The `this` binding of `func`. * @param {Array} partials The arguments to prepend to those provided to the new function. - * @returns {Function} Returns the new bound function. + * @returns {Function} Returns the new wrapped function. */ function createPartialWrapper(func, bitmask, thisArg, partials) { var isBind = bitmask & BIND_FLAG, Ctor = createCtorWrapper(func); function wrapper() { - // Avoid `arguments` object use disqualifying optimizations by - // converting it to an array before providing it `func`. var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, - args = Array(leftLength + argsLength); + args = Array(leftLength + argsLength), + fn = (this && this !== global && this instanceof wrapper) ? Ctor : func; while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; @@ -265,19 +411,54 @@ function createPartialWrapper(func, bitmask, thisArg, partials) { while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } - var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func; - return fn.apply(isBind ? thisArg : this, args); + return apply(fn, isBind ? thisArg : this, args); } return wrapper; } +/** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder to replace. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & CURRY_FLAG, + newArgPos = argPos ? copyArray(argPos) : undefined, + newsHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); + + if (!(bitmask & CURRY_BOUND_FLAG)) { + bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); + } + var result = wrapFunc(func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, arity); + + result.placeholder = placeholder; + return result; +} + /** * Creates a function that either curries or invokes `func` with optional * `this` binding and partially applied arguments. * * @private - * @param {Function|string} func The function or method name to reference. - * @param {number} bitmask The bitmask of flags. + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask of wrapper flags. * The bitmask may be composed of the following flags: * 1 - `_.bind` * 2 - `_.bindKey` @@ -306,7 +487,10 @@ function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, a bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); partials = holders = undefined; } - length -= (holders ? holders.length : 0); + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + if (bitmask & PARTIAL_RIGHT_FLAG) { var partialsRight = partials, holdersRight = holders; @@ -315,34 +499,30 @@ function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, a } var newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; - newData[9] = arity == null + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] == null ? (isBindKey ? 0 : func.length) - : (nativeMax(arity - length, 0) || 0); + : nativeMax(newData[9] - length, 0); - if (bitmask == BIND_FLAG) { - var result = createBindWrapper(newData[0], newData[2]); - } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) { - result = createPartialWrapper.apply(undefined, newData); + if (!arity && bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG)) { + bitmask &= ~(CURRY_FLAG | CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == BIND_FLAG) { + var result = createBaseWrapper(func, bitmask, thisArg); + } else if (bitmask == CURRY_FLAG || bitmask == CURRY_RIGHT_FLAG) { + result = createCurryWrapper(func, bitmask, arity); + } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !holders.length) { + result = createPartialWrapper(func, bitmask, thisArg, partials); } else { result = createHybridWrapper.apply(undefined, newData); } return result; } -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; -} - /** * Reorder `array` according to the specified indexes where the element at * the first index is assigned as the first element, the element at @@ -356,7 +536,7 @@ function isIndex(value, length) { function reorder(array, indexes) { var arrLength = array.length, length = nativeMin(indexes.length, arrLength), - oldArray = arrayCopy(array); + oldArray = copyArray(array); while (length--) { var index = indexes[length]; @@ -365,6 +545,30 @@ function reorder(array, indexes) { return array; } +/** + * 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 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('')`) @@ -382,14 +586,89 @@ function reorder(array, indexes) { * _.isObject([1, 2, 3]); * // => true * - * _.isObject(1); + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); * // => false */ function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; return !!value && (type == 'object' || type == 'function'); } +/** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ +function toInteger(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + var remainder = value % 1; + return value === value ? (remainder ? value - remainder : value) : 0; +} + +/** + * 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); +} + module.exports = createWrapper; diff --git a/lodash._createwrapper/package.json b/lodash._createwrapper/package.json index 2de31626d..6cdb66343 100644 --- a/lodash._createwrapper/package.json +++ b/lodash._createwrapper/package.json @@ -1,23 +1,16 @@ { "name": "lodash._createwrapper", - "version": "3.0.7", - "description": "The modern build of lodash’s internal `createWrapper` as a module.", + "version": "3.1.0", + "description": "The internal lodash function `createWrapper` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", "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", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "dependencies": { - "lodash._arraycopy": "^3.0.0", - "lodash._basecreate": "^3.0.0", - "lodash._replaceholders": "^3.0.0" - } + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } } diff --git a/lodash.ary/LICENSE b/lodash.ary/LICENSE index 9cd87e5dc..b054ca5a3 100644 --- a/lodash.ary/LICENSE +++ b/lodash.ary/LICENSE @@ -1,5 +1,5 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.ary/README.md b/lodash.ary/README.md index e45f1981d..887b6c8ae 100644 --- a/lodash.ary/README.md +++ b/lodash.ary/README.md @@ -1,20 +1,18 @@ -# lodash.ary v3.0.2 +# lodash.ary v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.ary` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.ary` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.ary ``` -In Node.js/io.js: - +In Node.js: ```js var ary = require('lodash.ary'); ``` -See the [documentation](https://lodash.com/docs#ary) or [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash.ary) for more details. +See the [documentation](https://lodash.com/docs#ary) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.ary) for more details. diff --git a/lodash.ary/index.js b/lodash.ary/index.js index 5aceda8f3..0194b931d 100644 --- a/lodash.ary/index.js +++ b/lodash.ary/index.js @@ -1,22 +1,18 @@ /** - * lodash 3.0.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var createWrapper = require('lodash._createwrapper'), - isIterateeCall = require('lodash._isiterateecall'); +var createWrapper = require('lodash._createwrapper'); /** Used to compose bitmasks for wrapper metadata. */ var ARY_FLAG = 128; -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - /** - * Creates a function that accepts up to `n` arguments ignoring any + * Creates a function that accepts up to `n` arguments, ignoring any * additional arguments. * * @static @@ -24,7 +20,7 @@ var nativeMax = Math.max; * @category Function * @param {Function} func The function to cap arguments for. * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. * @returns {Function} Returns the new function. * @example * @@ -32,10 +28,8 @@ var nativeMax = Math.max; * // => [6, 8, 10] */ function ary(func, n, guard) { - if (guard && isIterateeCall(func, n, guard)) { - n = undefined; - } - n = (func && n == null) ? func.length : nativeMax(+n || 0, 0); + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n); } diff --git a/lodash.ary/package.json b/lodash.ary/package.json index cc5a0036e..dd8a61dcd 100644 --- a/lodash.ary/package.json +++ b/lodash.ary/package.json @@ -1,23 +1,20 @@ { "name": "lodash.ary", - "version": "3.0.2", - "description": "The modern build of lodash’s `_.ary` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.ary` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, ary", "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", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._createwrapper": "^3.0.0", - "lodash._isiterateecall": "^3.0.0" + "lodash._createwrapper": "^3.0.0" } } diff --git a/lodash.assign/LICENSE.txt b/lodash.assign/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.assign/LICENSE.txt +++ b/lodash.assign/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.assign/README.md b/lodash.assign/README.md index ae64c6b97..2a89889b1 100644 --- a/lodash.assign/README.md +++ b/lodash.assign/README.md @@ -1,4 +1,4 @@ -# lodash.assign v3.0.0 +# lodash.assign v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.assign` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var assign = require('lodash.assign'); ``` -See the [documentation](https://lodash.com/docs#assign) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.assign) for more details. +See the [documentation](https://lodash.com/docs#assign) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.assign) for more details. diff --git a/lodash.assign/index.js b/lodash.assign/index.js index 7b9f87327..232996030 100644 --- a/lodash.assign/index.js +++ b/lodash.assign/index.js @@ -1,13 +1,102 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseAssign = require('lodash._baseassign'), - createAssigner = require('lodash._createassigner'); + createAssigner = require('lodash._createassigner'), + isNative = require('lodash.isnative'), + keys = require('lodash.keys'); + +/** Used for native method references. */ +var arrayProto = Array.prototype; + +/** Native method references. */ +var getOwnPropertySymbols = isNative(getOwnPropertySymbols = Object.getOwnPropertySymbols) && getOwnPropertySymbols, + push = arrayProto.push; + +/** + * A specialized version of `_.assign` for customizing assigned values without + * support for argument juggling, multiple sources, and `this` binding `customizer` + * functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + */ +function assignWith(object, source, customizer) { + var props = keys(source); + push.apply(props, getSymbols(source)); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index], + value = object[key], + result = customizer(value, source[key], key, object, source); + + if ((result === result ? (result !== value) : (value === value)) || + (value === undefined && !(key in object))) { + object[key] = result; + } + } + return object; +} + +/** + * Creates an array of the own symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !getOwnPropertySymbols ? constant([]) : function(object) { + return getOwnPropertySymbols(toObject(object)); +}; + +/** + * Converts `value` to an object if it is not one. + * + * @private + * @param {*} value The value to process. + * @returns {Object} Returns the object. + */ +function toObject(value) { + return isObject(value) ? value : Object(value); +} + +/** + * 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(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return type == 'function' || (!!value && type == 'object'); +} /** * Assigns own enumerable properties of source object(s) to the destination @@ -16,13 +105,16 @@ var baseAssign = require('lodash._baseassign'), * The `customizer` is bound to `thisArg` and invoked with five arguments: * (objectValue, sourceValue, key, object, source). * + * **Note:** This method mutates `object` and is based on + * [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign). + * * @static * @memberOf _ * @alias extend * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. - * @param {Function} [customizer] The function to customize assigning values. + * @param {Function} [customizer] The function to customize assigned values. * @param {*} [thisArg] The `this` binding of `customizer`. * @returns {Object} Returns `object`. * @example @@ -32,12 +124,38 @@ var baseAssign = require('lodash._baseassign'), * * // using a customizer callback * var defaults = _.partialRight(_.assign, function(value, other) { - * return typeof value == 'undefined' ? other : value; + * return _.isUndefined(value) ? other : value; * }); * * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); * // => { 'user': 'barney', 'age': 36 } */ -var assign = createAssigner(baseAssign); +var assign = createAssigner(function(object, source, customizer) { + return customizer + ? assignWith(object, source, customizer) + : baseAssign(object, source); +}); + +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @category Utility + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new function. + * @example + * + * var object = { 'user': 'fred' }; + * var getter = _.constant(object); + * + * getter() === object; + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} module.exports = assign; diff --git a/lodash.assign/package.json b/lodash.assign/package.json index 639740beb..563ff01db 100644 --- a/lodash.assign/package.json +++ b/lodash.assign/package.json @@ -1,6 +1,6 @@ { "name": "lodash.assign", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.assign` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,6 +18,8 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._baseassign": "^3.0.0", - "lodash._createassigner": "^3.0.0" + "lodash._createassigner": "^3.0.0", + "lodash.isnative": "^3.0.0", + "lodash.keys": "^3.0.0" } } diff --git a/lodash.at/LICENSE.txt b/lodash.at/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.at/LICENSE.txt +++ b/lodash.at/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.at/README.md b/lodash.at/README.md index 77fa904fe..a75af1186 100644 --- a/lodash.at/README.md +++ b/lodash.at/README.md @@ -1,4 +1,4 @@ -# lodash.at v3.0.0 +# lodash.at v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.at` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var at = require('lodash.at'); ``` -See the [documentation](https://lodash.com/docs#at) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.at) for more details. +See the [documentation](https://lodash.com/docs#at) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.at) for more details. diff --git a/lodash.at/index.js b/lodash.at/index.js index 84d56e505..16af39026 100644 --- a/lodash.at/index.js +++ b/lodash.at/index.js @@ -1,28 +1,26 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseAt = require('lodash._baseat'), baseFlatten = require('lodash._baseflatten'), - toIterable = require('lodash._toiterable'); + toIterable = require('lodash._toiterable'), + restParam = require('lodash.restparam'); /** - * Used as the maximum length of an array-like value. - * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) - * for more details. + * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) + * of an array-like value. */ var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; /** * Checks if `value` is a valid array-like length. * - * **Note:** This function is based on ES `ToLength`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) - * for more details. + * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). * * @private * @param {*} value The value to check. @@ -49,15 +47,15 @@ function isLength(value) { * _.at(['a', 'b', 'c'], [0, 2]); * // => ['a', 'c'] * - * _.at(['fred', 'barney', 'pebbles'], 0, 2); - * // => ['fred', 'pebbles'] + * _.at(['barney', 'fred', 'pebbles'], 0, 2); + * // => ['barney', 'pebbles'] */ -function at(collection) { +var at = restParam(function(collection, props) { var length = collection ? collection.length : 0; if (isLength(length)) { collection = toIterable(collection); } - return baseAt(collection, baseFlatten(arguments, false, false, 1)); -} + return baseAt(collection, baseFlatten(props)); +}); module.exports = at; diff --git a/lodash.at/package.json b/lodash.at/package.json index bc0187d52..887180f40 100644 --- a/lodash.at/package.json +++ b/lodash.at/package.json @@ -1,6 +1,6 @@ { "name": "lodash.at", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.at` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -19,6 +19,7 @@ "dependencies": { "lodash._baseat": "^3.0.0", "lodash._baseflatten": "^3.0.0", - "lodash._toiterable": "^3.0.0" + "lodash._toiterable": "^3.0.0", + "lodash.restparam": "^3.0.0" } } diff --git a/lodash.attempt/README.md b/lodash.attempt/README.md index e5073aa8d..cc3ead3c6 100644 --- a/lodash.attempt/README.md +++ b/lodash.attempt/README.md @@ -1,4 +1,4 @@ -# lodash.attempt v3.0.0 +# lodash.attempt v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.attempt` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var attempt = require('lodash.attempt'); ``` -See the [documentation](https://lodash.com/docs#attempt) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.attempt) for more details. +See the [documentation](https://lodash.com/docs#attempt) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.attempt) for more details. diff --git a/lodash.attempt/index.js b/lodash.attempt/index.js index 870a3c4b0..d96eb2997 100644 --- a/lodash.attempt/index.js +++ b/lodash.attempt/index.js @@ -1,16 +1,17 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.7.0 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var isError = require('lodash.iserror'); +var baseSlice = require('lodash._baseslice'), + isError = require('lodash.iserror'); /** - * Attempts to invoke `func`, returning either the result or the caught - * error object. + * Attempts to invoke `func`, returning either the result or the caught error + * object. Any additional arguments are provided to `func` when it is invoked. * * @static * @memberOf _ @@ -20,9 +21,9 @@ var isError = require('lodash.iserror'); * @example * * // avoid throwing errors for invalid selectors - * var elements = _.attempt(function() { + * var elements = _.attempt(function(selector) { * return document.querySelectorAll(selector); - * }); + * }, '>_>'); * * if (_.isError(elements)) { * elements = []; @@ -30,9 +31,9 @@ var isError = require('lodash.iserror'); */ function attempt(func) { try { - return func(); + return func.apply(undefined, baseSlice(arguments, 1)); } catch(e) { - return isError(e) ? e : Error(e); + return isError(e) ? e : new Error(e); } } diff --git a/lodash.attempt/package.json b/lodash.attempt/package.json index a86df9351..4111abe25 100644 --- a/lodash.attempt/package.json +++ b/lodash.attempt/package.json @@ -1,6 +1,6 @@ { "name": "lodash.attempt", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.attempt` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,7 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { + "lodash._baseslice": "^3.0.0", "lodash.iserror": "^3.0.0" } } diff --git a/lodash.bind/LICENSE.txt b/lodash.bind/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.bind/LICENSE.txt +++ b/lodash.bind/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.bind/README.md b/lodash.bind/README.md index 5ac5ca25e..789b9f287 100644 --- a/lodash.bind/README.md +++ b/lodash.bind/README.md @@ -1,4 +1,4 @@ -# lodash.bind v3.0.0 +# lodash.bind v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.bind` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var bind = require('lodash.bind'); ``` -See the [documentation](https://lodash.com/docs#bind) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.bind) for more details. +See the [documentation](https://lodash.com/docs#bind) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.bind) for more details. diff --git a/lodash.bind/index.js b/lodash.bind/index.js index 210de7543..aee2ac17d 100644 --- a/lodash.bind/index.js +++ b/lodash.bind/index.js @@ -1,14 +1,14 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseSlice = require('lodash._baseslice'), - createWrapper = require('lodash._createwrapper'), - replaceHolders = require('lodash._replaceholders'); +var createWrapper = require('lodash._createwrapper'), + replaceHolders = require('lodash._replaceholders'), + restParam = require('lodash.restparam'); /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, @@ -22,7 +22,7 @@ var BIND_FLAG = 1, * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for partially applied arguments. * - * **Note:** Unlike native `Function#bind` this method does not set the `length` + * **Note:** Unlike native `Function#bind` this method does not set the "length" * property of bound functions. * * @static @@ -30,7 +30,7 @@ var BIND_FLAG = 1, * @category Function * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [args] The arguments to be partially applied. + * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * @@ -49,16 +49,14 @@ var BIND_FLAG = 1, * bound('hi'); * // => 'hi fred!' */ -function bind(func, thisArg) { +var bind = restParam(function(func, thisArg, partials) { var bitmask = BIND_FLAG; - if (arguments.length > 2) { - var partials = baseSlice(arguments, 2), - holders = replaceHolders(partials, bind.placeholder); - + if (partials.length) { + var holders = replaceHolders(partials, bind.placeholder); bitmask |= PARTIAL_FLAG; } return createWrapper(func, bitmask, thisArg, partials, holders); -} +}); // Assign default placeholders. bind.placeholder = {}; diff --git a/lodash.bind/package.json b/lodash.bind/package.json index e76f5a18a..8733925a5 100644 --- a/lodash.bind/package.json +++ b/lodash.bind/package.json @@ -1,6 +1,6 @@ { "name": "lodash.bind", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.bind` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,8 +17,8 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._baseslice": "^3.0.0", "lodash._createwrapper": "^3.0.0", - "lodash._replaceholders": "^3.0.0" + "lodash._replaceholders": "^3.0.0", + "lodash.restparam": "^3.0.0" } } diff --git a/lodash.bindall/LICENSE.txt b/lodash.bindall/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.bindall/LICENSE.txt +++ b/lodash.bindall/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.bindall/README.md b/lodash.bindall/README.md index 7627446fd..99fe8cf70 100644 --- a/lodash.bindall/README.md +++ b/lodash.bindall/README.md @@ -1,4 +1,4 @@ -# lodash.bindall v3.0.0 +# lodash.bindall v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.bindAll` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var bindAll = require('lodash.bindall'); ``` -See the [documentation](https://lodash.com/docs#bindAll) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.bindall) for more details. +See the [documentation](https://lodash.com/docs#bindAll) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.bindall) for more details. diff --git a/lodash.bindall/index.js b/lodash.bindall/index.js index b1ce67e50..fd4413fab 100644 --- a/lodash.bindall/index.js +++ b/lodash.bindall/index.js @@ -1,45 +1,26 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseFlatten = require('lodash._baseflatten'), createWrapper = require('lodash._createwrapper'), - functions = require('lodash.functions'); + functions = require('lodash.functions'), + restParam = require('lodash.restparam'); /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1; -/** - * The base implementation of `_.bindAll` without support for individual - * method name arguments. - * - * @private - * @param {Object} object The object to bind and assign the bound methods to. - * @param {string[]} methodNames The object method names to bind. - * @returns {Object} Returns `object`. - */ -function baseBindAll(object, methodNames) { - var index = -1, - length = methodNames.length; - - while (++index < length) { - var key = methodNames[index]; - object[key] = createWrapper(object[key], BIND_FLAG, object); - } - return object; -} - /** * Binds methods of an object to the object itself, overwriting the existing * method. Method names may be specified as individual arguments or as arrays * of method names. If no method names are provided all enumerable function * properties, own and inherited, of `object` are bound. * - * **Note:** This method does not set the `length` property of bound functions. + * **Note:** This method does not set the "length" property of bound functions. * * @static * @memberOf _ @@ -61,12 +42,17 @@ function baseBindAll(object, methodNames) { * jQuery('#docs').on('click', view.onClick); * // => logs 'clicked docs' when the element is clicked */ -function bindAll(object) { - return baseBindAll(object, - arguments.length > 1 - ? baseFlatten(arguments, false, false, 1) - : functions(object) - ); -} +var bindAll = restParam(function(object, methodNames) { + methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object); + + var index = -1, + length = methodNames.length; + + while (++index < length) { + var key = methodNames[index]; + object[key] = createWrapper(object[key], BIND_FLAG, object); + } + return object; +}); module.exports = bindAll; diff --git a/lodash.bindall/package.json b/lodash.bindall/package.json index e198b6c6a..7686485e9 100644 --- a/lodash.bindall/package.json +++ b/lodash.bindall/package.json @@ -1,6 +1,6 @@ { "name": "lodash.bindall", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.bindAll` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -19,6 +19,7 @@ "dependencies": { "lodash._baseflatten": "^3.0.0", "lodash._createwrapper": "^3.0.0", - "lodash.functions": "^3.0.0" + "lodash.functions": "^3.0.0", + "lodash.restparam": "^3.0.0" } } diff --git a/lodash.bindkey/LICENSE.txt b/lodash.bindkey/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.bindkey/LICENSE.txt +++ b/lodash.bindkey/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.bindkey/README.md b/lodash.bindkey/README.md index df2c16d7d..3e16aded3 100644 --- a/lodash.bindkey/README.md +++ b/lodash.bindkey/README.md @@ -1,4 +1,4 @@ -# lodash.bindkey v3.0.0 +# lodash.bindkey v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.bindKey` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var bindKey = require('lodash.bindkey'); ``` -See the [documentation](https://lodash.com/docs#bindKey) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.bindkey) for more details. +See the [documentation](https://lodash.com/docs#bindKey) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.bindkey) for more details. diff --git a/lodash.bindkey/index.js b/lodash.bindkey/index.js index e6a3303ee..09a335fff 100644 --- a/lodash.bindkey/index.js +++ b/lodash.bindkey/index.js @@ -1,14 +1,14 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseSlice = require('lodash._baseslice'), - createWrapper = require('lodash._createwrapper'), - replaceHolders = require('lodash._replaceholders'); +var createWrapper = require('lodash._createwrapper'), + replaceHolders = require('lodash._replaceholders'), + restParam = require('lodash.restparam'); /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, @@ -21,7 +21,7 @@ var BIND_FLAG = 1, * * This method differs from `_.bind` by allowing bound functions to reference * methods that may be redefined or don't yet exist. - * See [Peter Michaux's article](http://michaux.ca/articles/lazy-function-definition-pattern) + * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) * for more details. * * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic @@ -32,7 +32,7 @@ var BIND_FLAG = 1, * @category Function * @param {Object} object The object the method belongs to. * @param {string} key The key of the method. - * @param {...*} [args] The arguments to be partially applied. + * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * @@ -59,16 +59,14 @@ var BIND_FLAG = 1, * bound('hi'); * // => 'hiya fred!' */ -function bindKey(object, key) { +var bindKey = restParam(function(object, key, partials) { var bitmask = BIND_FLAG | BIND_KEY_FLAG; - if (arguments.length > 2) { - var partials = baseSlice(arguments, 2), - holders = replaceHolders(partials, bindKey.placeholder); - + if (partials.length) { + var holders = replaceHolders(partials, bindKey.placeholder); bitmask |= PARTIAL_FLAG; } return createWrapper(key, bitmask, object, partials, holders); -} +}); // Assign default placeholders. bindKey.placeholder = {}; diff --git a/lodash.bindkey/package.json b/lodash.bindkey/package.json index ee30ae697..4bcf5d72d 100644 --- a/lodash.bindkey/package.json +++ b/lodash.bindkey/package.json @@ -1,6 +1,6 @@ { "name": "lodash.bindkey", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.bindKey` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,8 +17,8 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._baseslice": "^3.0.0", "lodash._createwrapper": "^3.0.0", - "lodash._replaceholders": "^3.0.0" + "lodash._replaceholders": "^3.0.0", + "lodash.restparam": "^3.0.0" } } diff --git a/lodash.callback/README.md b/lodash.callback/README.md index ab83aeb59..9f9da833e 100644 --- a/lodash.callback/README.md +++ b/lodash.callback/README.md @@ -1,4 +1,4 @@ -# lodash.callback v3.0.0 +# lodash.callback v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.callback` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,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.0.0-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.1.0-npm-packages/lodash.callback) for more details. diff --git a/lodash.callback/index.js b/lodash.callback/index.js index 1bb7a8daa..90eb49ddd 100644 --- a/lodash.callback/index.js +++ b/lodash.callback/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.7.0 @@ -7,13 +7,27 @@ * Available under MIT license */ var baseCallback = require('lodash._basecallback'), + baseClone = require('lodash._baseclone'), + baseMatches = require('lodash._basematches'), isIterateeCall = require('lodash._isiterateecall'); /** - * Creates a function bound to an optional `thisArg`. If `func` is a property - * name the created callback returns the property value for a given element. - * If `func` is an object the created callback returns `true` for elements - * that contain the equivalent object properties, otherwise it returns `false`. + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return (value && typeof value == 'object') || false; +} + +/** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and arguments of the created function. If `func` is a property name the + * created callback returns the property value for a given element. If `func` + * is an object the created callback returns `true` for elements that contain + * the equivalent object properties, otherwise it returns `false`. * * @static * @memberOf _ @@ -37,7 +51,9 @@ var baseCallback = require('lodash._basecallback'), * return callback(func, thisArg); * } * return function(object) { - * return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3]; + * return match[2] == 'gt' + * ? object[match[1]] > match[3] + * : object[match[1]] < match[3]; * }; * }); * @@ -48,7 +64,38 @@ function callback(func, thisArg, guard) { if (guard && isIterateeCall(func, thisArg, guard)) { thisArg = null; } - return baseCallback(func, thisArg); + return isObjectLike(func) + ? matches(func) + : baseCallback(func, thisArg); +} + +/** + * Creates a function which performs a deep comparison between a given object + * and `source`, returning `true` if the given object has equivalent property + * values, else `false`. + * + * **Note:** This method supports comparing arrays, booleans, `Date` objects, + * numbers, `Object` objects, regexes, and strings. Objects are compared by + * their own, not inherited, enumerable properties. For comparing a single + * own or inherited property value see `_.matchesProperty`. + * + * @static + * @memberOf _ + * @category Utility + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new function. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, _.matches({ 'age': 40, 'active': false })); + * // => [{ 'user': 'fred', 'age': 40, 'active': false }] + */ +function matches(source) { + return baseMatches(baseClone(source, true)); } module.exports = callback; diff --git a/lodash.callback/package.json b/lodash.callback/package.json index b2cdbf626..fe8f45ff8 100644 --- a/lodash.callback/package.json +++ b/lodash.callback/package.json @@ -1,6 +1,6 @@ { "name": "lodash.callback", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.callback` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,6 +18,8 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._basecallback": "^3.0.0", + "lodash._baseclone": "^3.0.0", + "lodash._basematches": "^3.0.0", "lodash._isiterateecall": "^3.0.0" } } diff --git a/lodash.deburr/LICENSE.txt b/lodash.capitalize/LICENSE similarity index 89% rename from lodash.deburr/LICENSE.txt rename to lodash.capitalize/LICENSE index 9cd87e5dc..b054ca5a3 100644 --- a/lodash.deburr/LICENSE.txt +++ b/lodash.capitalize/LICENSE @@ -1,5 +1,5 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.capitalize/README.md b/lodash.capitalize/README.md index dc6996f81..d641a2151 100644 --- a/lodash.capitalize/README.md +++ b/lodash.capitalize/README.md @@ -1,20 +1,18 @@ -# lodash.capitalize v3.0.0 +# lodash.capitalize v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.capitalize` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.capitalize` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.capitalize ``` -In Node.js/io.js: - +In Node.js: ```js var capitalize = require('lodash.capitalize'); ``` -See the [documentation](https://lodash.com/docs#capitalize) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.capitalize) for more details. +See the [documentation](https://lodash.com/docs#capitalize) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.capitalize) for more details. diff --git a/lodash.capitalize/index.js b/lodash.capitalize/index.js index f449c8074..1a81c94e2 100644 --- a/lodash.capitalize/index.js +++ b/lodash.capitalize/index.js @@ -1,15 +1,121 @@ /** - * lodash 3.0.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseToString = require('lodash._basetostring'); +var upperFirst = require('lodash.upperfirst'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used for built-in method references. */ +var objectProto = global.Object.prototype; /** - * Capitalizes the first character of `string`. + * 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 value references. */ +var _Symbol = global.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = _Symbol ? _Symbol.prototype : undefined, + symbolToString = _Symbol ? symbolProto.toString : undefined; + +/** + * 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 _ + * @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 _ + * @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); +} + +/** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return _Symbol ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Converts the first character of `string` to upper case and the remaining + * to lower case. * * @static * @memberOf _ @@ -18,12 +124,11 @@ var baseToString = require('lodash._basetostring'); * @returns {string} Returns the capitalized string. * @example * - * _.capitalize('fred'); + * _.capitalize('FRED'); * // => 'Fred' */ function capitalize(string) { - string = baseToString(string); - return string && (string.charAt(0).toUpperCase() + string.slice(1)); + return upperFirst(toString(string).toLowerCase()); } module.exports = capitalize; diff --git a/lodash.capitalize/package.json b/lodash.capitalize/package.json index b04a85372..a9ac05fc9 100644 --- a/lodash.capitalize/package.json +++ b/lodash.capitalize/package.json @@ -1,22 +1,20 @@ { "name": "lodash.capitalize", - "version": "3.0.0", - "description": "The modern build of lodash’s `_.capitalize` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.capitalize` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, capitalize", "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", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._basetostring": "^3.0.0" + "lodash.upperfirst": "^3.0.0" } } diff --git a/lodash.countby/LICENSE.txt b/lodash.countby/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.countby/LICENSE.txt +++ b/lodash.countby/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.countby/README.md b/lodash.countby/README.md index 6a953991d..66bb651c9 100644 --- a/lodash.countby/README.md +++ b/lodash.countby/README.md @@ -1,4 +1,4 @@ -# lodash.countby v3.0.0 +# lodash.countby v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.countBy` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var countBy = require('lodash.countby'); ``` -See the [documentation](https://lodash.com/docs#countBy) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.countby) for more details. +See the [documentation](https://lodash.com/docs#countBy) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.countby) for more details. diff --git a/lodash.countby/index.js b/lodash.countby/index.js index 87c50f564..ce260465a 100644 --- a/lodash.countby/index.js +++ b/lodash.countby/index.js @@ -1,12 +1,13 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var createAggregator = require('lodash._createaggregator'); +var createAggregator = require('lodash._createaggregator'), + keys = require('lodash.keys'); /** Used for native method references. */ var objectProto = Object.prototype; diff --git a/lodash.countby/package.json b/lodash.countby/package.json index 5b3a0842e..9268c0934 100644 --- a/lodash.countby/package.json +++ b/lodash.countby/package.json @@ -1,6 +1,6 @@ { "name": "lodash.countby", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.countBy` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,7 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._createaggregator": "^3.0.0" + "lodash._createaggregator": "^3.0.0", + "lodash.keys": "^3.0.0" } } diff --git a/lodash.create/LICENSE.txt b/lodash.create/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.create/LICENSE.txt +++ b/lodash.create/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.create/README.md b/lodash.create/README.md index 6e2b970cc..581453fab 100644 --- a/lodash.create/README.md +++ b/lodash.create/README.md @@ -1,4 +1,4 @@ -# lodash.create v3.0.0 +# lodash.create v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.create` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var create = require('lodash.create'); ``` -See the [documentation](https://lodash.com/docs#create) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.create) for more details. +See the [documentation](https://lodash.com/docs#create) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.create) for more details. diff --git a/lodash.create/index.js b/lodash.create/index.js index 7c7755d73..e6d32521f 100644 --- a/lodash.create/index.js +++ b/lodash.create/index.js @@ -1,15 +1,14 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseCopy = require('lodash._basecopy'), +var baseAssign = require('lodash._baseassign'), baseCreate = require('lodash._basecreate'), - isIterateeCall = require('lodash._isiterateecall'), - keys = require('lodash.keys'); + isIterateeCall = require('lodash._isiterateecall'); /** * Creates an object that inherits from the given `prototype` object. If a @@ -50,7 +49,7 @@ function create(prototype, properties, guard) { if (guard && isIterateeCall(prototype, properties, guard)) { properties = null; } - return properties ? baseCopy(properties, result, keys(properties)) : result; + return properties ? baseAssign(result, properties) : result; } module.exports = create; diff --git a/lodash.create/package.json b/lodash.create/package.json index 685173ee9..6de6eaaf0 100644 --- a/lodash.create/package.json +++ b/lodash.create/package.json @@ -1,6 +1,6 @@ { "name": "lodash.create", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.create` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,9 +17,8 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._basecopy": "^3.0.0", + "lodash._baseassign": "^3.0.0", "lodash._basecreate": "^3.0.0", - "lodash._isiterateecall": "^3.0.0", - "lodash.keys": "^3.0.0" + "lodash._isiterateecall": "^3.0.0" } } diff --git a/lodash.curry/LICENSE b/lodash.curry/LICENSE index 9cd87e5dc..b054ca5a3 100644 --- a/lodash.curry/LICENSE +++ b/lodash.curry/LICENSE @@ -1,5 +1,5 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.curry/README.md b/lodash.curry/README.md index b71d35b33..060577546 100644 --- a/lodash.curry/README.md +++ b/lodash.curry/README.md @@ -1,20 +1,18 @@ -# lodash.curry v3.0.2 +# lodash.curry v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.curry` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.curry` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.curry ``` -In Node.js/io.js: - +In Node.js: ```js var curry = require('lodash.curry'); ``` -See the [documentation](https://lodash.com/docs#curry) or [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash.curry) for more details. +See the [documentation](https://lodash.com/docs#curry) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.curry) for more details. diff --git a/lodash.curry/index.js b/lodash.curry/index.js index 889bdd60b..0ded7a574 100644 --- a/lodash.curry/index.js +++ b/lodash.curry/index.js @@ -1,54 +1,34 @@ /** - * lodash 3.0.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var createWrapper = require('lodash._createwrapper'), - isIterateeCall = require('lodash._isiterateecall'); +var createWrapper = require('lodash._createwrapper'); /** Used to compose bitmasks for wrapper metadata. */ var CURRY_FLAG = 8; /** - * Creates a `_.curry` or `_.curryRight` function. - * - * @private - * @param {boolean} flag The curry bit flag. - * @returns {Function} Returns the new curry function. - */ -function createCurry(flag) { - function curryFunc(func, arity, guard) { - if (guard && isIterateeCall(func, arity, guard)) { - arity = undefined; - } - var result = createWrapper(func, flag, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curryFunc.placeholder; - return result; - } - return curryFunc; -} - -/** - * Creates a function that accepts one or more arguments of `func` that when - * called either invokes `func` returning its result, if all `func` arguments - * have been provided, or returns a function that accepts one or more of the - * remaining `func` arguments, and so on. The arity of `func` may be specified - * if `func.length` is not sufficient. + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. * * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for provided arguments. * - * **Note:** This method does not set the "length" property of curried functions. + * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. * @returns {Function} Returns the new curried function. * @example * @@ -67,13 +47,15 @@ function createCurry(flag) { * curried(1, 2, 3); * // => [1, 2, 3] * - * // using placeholders + * // Curried with placeholders. * curried(1)(_, 3)(2); * // => [1, 2, 3] */ -var curry = createCurry(CURRY_FLAG); - -// Assign default placeholders. -curry.placeholder = {}; +function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrapper(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; +} module.exports = curry; diff --git a/lodash.curry/package.json b/lodash.curry/package.json index 0526df645..5dbb88978 100644 --- a/lodash.curry/package.json +++ b/lodash.curry/package.json @@ -1,23 +1,20 @@ { "name": "lodash.curry", - "version": "3.0.2", - "description": "The modern build of lodash’s `_.curry` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.curry` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, curry", "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", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._createwrapper": "^3.0.0", - "lodash._isiterateecall": "^3.0.0" + "lodash._createwrapper": "^3.0.0" } } diff --git a/lodash.curryright/LICENSE b/lodash.curryright/LICENSE index 9cd87e5dc..b054ca5a3 100644 --- a/lodash.curryright/LICENSE +++ b/lodash.curryright/LICENSE @@ -1,5 +1,5 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.curryright/README.md b/lodash.curryright/README.md index 8fa7191b7..7a39c250f 100644 --- a/lodash.curryright/README.md +++ b/lodash.curryright/README.md @@ -1,20 +1,18 @@ -# lodash.curryright v3.0.2 +# lodash.curryright v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.curryRight` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.curryRight` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.curryright ``` -In Node.js/io.js: - +In Node.js: ```js var curryRight = require('lodash.curryright'); ``` -See the [documentation](https://lodash.com/docs#curryRight) or [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash.curryright) for more details. +See the [documentation](https://lodash.com/docs#curryRight) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.curryright) for more details. diff --git a/lodash.curryright/index.js b/lodash.curryright/index.js index 93bd356ed..a217c416b 100644 --- a/lodash.curryright/index.js +++ b/lodash.curryright/index.js @@ -1,36 +1,16 @@ /** - * lodash 3.0.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var createWrapper = require('lodash._createwrapper'), - isIterateeCall = require('lodash._isiterateecall'); +var createWrapper = require('lodash._createwrapper'); /** Used to compose bitmasks for wrapper metadata. */ var CURRY_RIGHT_FLAG = 16; -/** - * Creates a `_.curry` or `_.curryRight` function. - * - * @private - * @param {boolean} flag The curry bit flag. - * @returns {Function} Returns the new curry function. - */ -function createCurry(flag) { - function curryFunc(func, arity, guard) { - if (guard && isIterateeCall(func, arity, guard)) { - arity = undefined; - } - var result = createWrapper(func, flag, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curryFunc.placeholder; - return result; - } - return curryFunc; -} - /** * This method is like `_.curry` except that arguments are applied to `func` * in the manner of `_.partialRight` instead of `_.partial`. @@ -38,14 +18,14 @@ function createCurry(flag) { * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for provided arguments. * - * **Note:** This method does not set the "length" property of curried functions. + * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. * @returns {Function} Returns the new curried function. * @example * @@ -64,13 +44,15 @@ function createCurry(flag) { * curried(1, 2, 3); * // => [1, 2, 3] * - * // using placeholders + * // Curried with placeholders. * curried(3)(1, _)(2); * // => [1, 2, 3] */ -var curryRight = createCurry(CURRY_RIGHT_FLAG); - -// Assign default placeholders. -curryRight.placeholder = {}; +function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrapper(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; +} module.exports = curryRight; diff --git a/lodash.curryright/package.json b/lodash.curryright/package.json index d84cb27b6..63fec2954 100644 --- a/lodash.curryright/package.json +++ b/lodash.curryright/package.json @@ -1,23 +1,20 @@ { "name": "lodash.curryright", - "version": "3.0.2", - "description": "The modern build of lodash’s `_.curryRight` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.curryRight` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, curryright", "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", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._createwrapper": "^3.0.0", - "lodash._isiterateecall": "^3.0.0" + "lodash._createwrapper": "^3.0.0" } } diff --git a/lodash.debounce/README.md b/lodash.debounce/README.md index 5bffb8e72..6a3c1c18d 100644 --- a/lodash.debounce/README.md +++ b/lodash.debounce/README.md @@ -1,4 +1,4 @@ -# lodash.debounce v3.0.3 +# lodash.debounce v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.debounce` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var debounce = require('lodash.debounce'); ``` -See the [documentation](https://lodash.com/docs#debounce) or [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash.debounce) for more details. +See the [documentation](https://lodash.com/docs#debounce) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.debounce) for more details. diff --git a/lodash.debounce/index.js b/lodash.debounce/index.js index f6e43bfcd..d6074e0cf 100644 --- a/lodash.debounce/index.js +++ b/lodash.debounce/index.js @@ -1,19 +1,19 @@ /** - * lodash 3.0.3 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.2 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var isNative = require('lodash.isnative'); +var getNative = require('lodash._getnative'); /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; /* Native method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max, - nativeNow = isNative(nativeNow = Date.now) && nativeNow; + nativeNow = getNative(Date, 'now'); /** * Gets the number of milliseconds that have elapsed since the Unix epoch @@ -34,12 +34,13 @@ var now = nativeNow || function() { }; /** - * Creates a function that delays invoking `func` until after `wait` milliseconds - * have elapsed since the last time it was invoked. The created function comes - * with a `cancel` method to cancel delayed invocations. Provide an options - * object to indicate that `func` should be invoked on the leading and/or - * trailing edge of the `wait` timeout. Subsequent calls to the debounced - * function return the result of the last `func` invocation. + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed invocations. Provide an options object to indicate that `func` + * should be invoked on the leading and/or trailing edge of the `wait` timeout. + * Subsequent calls to the debounced function return the result of the last + * `func` invocation. * * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked * on the trailing edge of the timeout only if the the debounced function is @@ -233,7 +234,7 @@ function isObject(value) { // Avoid a V8 JIT bug in Chrome 19-20. // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; - return type == 'function' || (!!value && type == 'object'); + return !!value && (type == 'object' || type == 'function'); } module.exports = debounce; diff --git a/lodash.debounce/package.json b/lodash.debounce/package.json index 03d4eb12a..00c6cecf8 100644 --- a/lodash.debounce/package.json +++ b/lodash.debounce/package.json @@ -1,6 +1,6 @@ { "name": "lodash.debounce", - "version": "3.0.3", + "version": "3.1.0", "description": "The modern build of lodash’s `_.debounce` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,6 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash.isnative": "^3.0.0" + "lodash._getnative": "^3.0.0" } } diff --git a/lodash.endswith/LICENSE.txt b/lodash.deburr/LICENSE similarity index 89% rename from lodash.endswith/LICENSE.txt rename to lodash.deburr/LICENSE index 9cd87e5dc..b054ca5a3 100644 --- a/lodash.endswith/LICENSE.txt +++ b/lodash.deburr/LICENSE @@ -1,5 +1,5 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.deburr/README.md b/lodash.deburr/README.md index 19d789c6f..1cdf3b55f 100644 --- a/lodash.deburr/README.md +++ b/lodash.deburr/README.md @@ -1,20 +1,18 @@ -# lodash.deburr v3.0.2 +# lodash.deburr v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.deburr` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.deburr` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.deburr ``` -In Node.js/io.js: - +In Node.js: ```js var deburr = require('lodash.deburr'); ``` -See the [documentation](https://lodash.com/docs#deburr) or [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash.deburr) for more details. +See the [documentation](https://lodash.com/docs#deburr) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.deburr) for more details. diff --git a/lodash.deburr/index.js b/lodash.deburr/index.js index 3bbda44ba..27a22e843 100644 --- a/lodash.deburr/index.js +++ b/lodash.deburr/index.js @@ -1,19 +1,30 @@ /** - * lodash 3.0.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseToString = require('lodash._basetostring'); -/** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */ -var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g; +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; /** Used to match latin-1 supplementary letters (excluding mathematical operators). */ var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g; +/** Used to compose unicode character classes. */ +var rsComboRange = '\\u0300-\\u036f\\ufe20-\\ufe23'; + +/** Used to compose unicode capture groups. */ +var rsCombo = '[' + rsComboRange + ']'; + +/** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */ +var reComboMark = RegExp(rsCombo, 'g'); + /** Used to map latin-1 supplementary letters to basic latin letters. */ var deburredLetters = { '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', @@ -46,6 +57,105 @@ function deburrLetter(letter) { return deburredLetters[letter]; } +/** Used for built-in method references. */ +var objectProto = global.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 value references. */ +var _Symbol = global.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = _Symbol ? _Symbol.prototype : undefined, + symbolToString = _Symbol ? symbolProto.toString : undefined; + +/** + * 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 _ + * @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 _ + * @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); +} + +/** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return _Symbol ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + /** * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). @@ -61,7 +171,7 @@ function deburrLetter(letter) { * // => 'deja vu' */ function deburr(string) { - string = baseToString(string); + string = toString(string); return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, ''); } diff --git a/lodash.deburr/package.json b/lodash.deburr/package.json index 2ede9010f..257194208 100644 --- a/lodash.deburr/package.json +++ b/lodash.deburr/package.json @@ -1,22 +1,17 @@ { "name": "lodash.deburr", - "version": "3.0.2", - "description": "The modern build of lodash’s `_.deburr` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.deburr` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, deburr", "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", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "dependencies": { - "lodash._basetostring": "^3.0.0" - } + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } } diff --git a/lodash.defaults/LICENSE.txt b/lodash.defaults/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.defaults/LICENSE.txt +++ b/lodash.defaults/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.defaults/README.md b/lodash.defaults/README.md index 84b6e2bcd..b91815c58 100644 --- a/lodash.defaults/README.md +++ b/lodash.defaults/README.md @@ -1,4 +1,4 @@ -# lodash.defaults v3.0.0 +# lodash.defaults v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.defaults` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var defaults = require('lodash.defaults'); ``` -See the [documentation](https://lodash.com/docs#defaults) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.defaults) for more details. +See the [documentation](https://lodash.com/docs#defaults) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.defaults) for more details. diff --git a/lodash.defaults/index.js b/lodash.defaults/index.js index d42962d9d..85e67ac87 100644 --- a/lodash.defaults/index.js +++ b/lodash.defaults/index.js @@ -1,13 +1,13 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var arrayCopy = require('lodash._arraycopy'), - assign = require('lodash.assign'); +var assign = require('lodash.assign'), + restParam = require('lodash.restparam'); /** * Used by `_.defaults` to customize its `_.assign` use. @@ -37,13 +37,13 @@ function assignDefaults(objectValue, sourceValue) { * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); * // => { 'user': 'barney', 'age': 36 } */ -function defaults(object) { +var defaults = restParam(function(args) { + var object = args[0]; if (object == null) { return object; } - var args = arrayCopy(arguments); args.push(assignDefaults); return assign.apply(undefined, args); -} +}); module.exports = defaults; diff --git a/lodash.defaults/package.json b/lodash.defaults/package.json index 54e4622ad..331ceb47a 100644 --- a/lodash.defaults/package.json +++ b/lodash.defaults/package.json @@ -1,6 +1,6 @@ { "name": "lodash.defaults", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.defaults` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,7 +17,7 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._arraycopy": "^3.0.0", - "lodash.assign": "^3.0.0" + "lodash.assign": "^3.0.0", + "lodash.restparam": "^3.0.0" } } diff --git a/lodash.defer/LICENSE.txt b/lodash.defer/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.defer/LICENSE.txt +++ b/lodash.defer/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.defer/README.md b/lodash.defer/README.md index d4198547e..f598a96be 100644 --- a/lodash.defer/README.md +++ b/lodash.defer/README.md @@ -1,4 +1,4 @@ -# lodash.defer v3.0.0 +# lodash.defer v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.defer` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var defer = require('lodash.defer'); ``` -See the [documentation](https://lodash.com/docs#defer) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.defer) for more details. +See the [documentation](https://lodash.com/docs#defer) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.defer) for more details. diff --git a/lodash.defer/index.js b/lodash.defer/index.js index e3764cab2..6f562a93b 100644 --- a/lodash.defer/index.js +++ b/lodash.defer/index.js @@ -1,16 +1,17 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseDelay = require('lodash._basedelay'); +var baseDelay = require('lodash._basedelay'), + restParam = require('lodash.restparam'); /** * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it is invoked. + * additional arguments are provided to `func` when it's invoked. * * @static * @memberOf _ @@ -25,8 +26,8 @@ var baseDelay = require('lodash._basedelay'); * }, 'deferred'); * // logs 'deferred' after one or more milliseconds */ -function defer(func) { - return baseDelay(func, 1, arguments, 1); -} +var defer = restParam(function(func, args) { + return baseDelay(func, 1, args); +}); module.exports = defer; diff --git a/lodash.defer/package.json b/lodash.defer/package.json index 28dad021b..d40d7fd7c 100644 --- a/lodash.defer/package.json +++ b/lodash.defer/package.json @@ -1,6 +1,6 @@ { "name": "lodash.defer", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.defer` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,7 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._basedelay": "^3.0.0" + "lodash._basedelay": "^3.0.0", + "lodash.restparam": "^3.0.0" } } diff --git a/lodash.delay/LICENSE.txt b/lodash.delay/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.delay/LICENSE.txt +++ b/lodash.delay/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.delay/README.md b/lodash.delay/README.md index 3dd427788..78793891b 100644 --- a/lodash.delay/README.md +++ b/lodash.delay/README.md @@ -1,4 +1,4 @@ -# lodash.delay v3.0.0 +# lodash.delay v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.delay` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var delay = require('lodash.delay'); ``` -See the [documentation](https://lodash.com/docs#delay) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.delay) for more details. +See the [documentation](https://lodash.com/docs#delay) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.delay) for more details. diff --git a/lodash.delay/index.js b/lodash.delay/index.js index bcec2a5a3..6a1a16c09 100644 --- a/lodash.delay/index.js +++ b/lodash.delay/index.js @@ -1,16 +1,17 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseDelay = require('lodash._basedelay'); +var baseDelay = require('lodash._basedelay'), + restParam = require('lodash.restparam'); /** * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it is invoked. + * provided to `func` when it's invoked. * * @static * @memberOf _ @@ -26,8 +27,8 @@ var baseDelay = require('lodash._basedelay'); * }, 1000, 'later'); * // => logs 'later' after one second */ -function delay(func, wait) { - return baseDelay(func, wait, arguments, 2); -} +var delay = restParam(function(func, wait, args) { + return baseDelay(func, wait, args); +}); module.exports = delay; diff --git a/lodash.delay/package.json b/lodash.delay/package.json index 80d7f039d..91bc70df5 100644 --- a/lodash.delay/package.json +++ b/lodash.delay/package.json @@ -1,6 +1,6 @@ { "name": "lodash.delay", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.delay` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,7 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._basedelay": "^3.0.0" + "lodash._basedelay": "^3.0.0", + "lodash.restparam": "^3.0.0" } } diff --git a/lodash.difference/LICENSE.txt b/lodash.difference/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.difference/LICENSE.txt +++ b/lodash.difference/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.difference/README.md b/lodash.difference/README.md index 7a8bf1ad0..71af40fc0 100644 --- a/lodash.difference/README.md +++ b/lodash.difference/README.md @@ -1,4 +1,4 @@ -# lodash.difference v3.0.1 +# lodash.difference v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.difference` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var difference = require('lodash.difference'); ``` -See the [documentation](https://lodash.com/docs#difference) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.difference) for more details. +See the [documentation](https://lodash.com/docs#difference) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.difference) for more details. diff --git a/lodash.difference/index.js b/lodash.difference/index.js index aa2a7c1e3..3ff7fdd70 100644 --- a/lodash.difference/index.js +++ b/lodash.difference/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.2 @@ -9,16 +9,16 @@ var baseDifference = require('lodash._basedifference'), baseFlatten = require('lodash._baseflatten'), isArguments = require('lodash.isarguments'), - isArray = require('lodash.isarray'); + isArray = require('lodash.isarray'), + restParam = require('lodash.restparam'); /** * Creates an array excluding all values of the provided arrays using * `SameValueZero` for equality comparisons. * - * **Note:** `SameValueZero` comparisons are like strict equality comparisons, - * e.g. `===`, except that `NaN` matches `NaN`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for more details. + * **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) + * comparisons are like strict equality comparisons, e.g. `===`, except that + * `NaN` matches `NaN`. * * @static * @memberOf _ @@ -31,18 +31,10 @@ var baseDifference = require('lodash._basedifference'), * _.difference([1, 2, 3], [4, 2]); * // => [1, 3] */ -function difference() { - var args = arguments, - index = -1, - length = args.length; - - while (++index < length) { - var value = args[index]; - if (isArray(value) || isArguments(value)) { - break; - } - } - return baseDifference(value, baseFlatten(args, false, true, ++index)); -} +var difference = restParam(function(array, values) { + return (isArray(array) || isArguments(array)) + ? baseDifference(array, baseFlatten(values, false, true)) + : []; +}); module.exports = difference; diff --git a/lodash.difference/package.json b/lodash.difference/package.json index 9e9fcae94..b6995bd47 100644 --- a/lodash.difference/package.json +++ b/lodash.difference/package.json @@ -1,6 +1,6 @@ { "name": "lodash.difference", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s `_.difference` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -20,6 +20,7 @@ "lodash._basedifference": "^3.0.0", "lodash._baseflatten": "^3.0.0", "lodash.isarguments": "^3.0.0", - "lodash.isarray": "^3.0.0" + "lodash.isarray": "^3.0.0", + "lodash.restparam": "^3.0.0" } } diff --git a/lodash.droprightwhile/README.md b/lodash.droprightwhile/README.md index c8b83c2e0..006a40f0a 100644 --- a/lodash.droprightwhile/README.md +++ b/lodash.droprightwhile/README.md @@ -1,4 +1,4 @@ -# lodash.droprightwhile v3.0.1 +# lodash.droprightwhile v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.dropRightWhile` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var dropRightWhile = require('lodash.droprightwhile'); ``` -See the [documentation](https://lodash.com/docs#dropRightWhile) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.droprightwhile) for more details. +See the [documentation](https://lodash.com/docs#dropRightWhile) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.droprightwhile) for more details. diff --git a/lodash.droprightwhile/index.js b/lodash.droprightwhile/index.js index b49d6fc71..be9e8c754 100644 --- a/lodash.droprightwhile/index.js +++ b/lodash.droprightwhile/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.2 @@ -7,7 +7,8 @@ * Available under MIT license */ var baseCallback = require('lodash._basecallback'), - baseSlice = require('lodash._baseslice'); + baseSlice = require('lodash._baseslice'), + isArray = require('lodash.isarray'); /** * The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`, diff --git a/lodash.droprightwhile/package.json b/lodash.droprightwhile/package.json index 20c066657..5cbfacd88 100644 --- a/lodash.droprightwhile/package.json +++ b/lodash.droprightwhile/package.json @@ -1,6 +1,6 @@ { "name": "lodash.droprightwhile", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s `_.dropRightWhile` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,6 +18,7 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._basecallback": "^3.0.0", - "lodash._baseslice": "^3.0.0" + "lodash._baseslice": "^3.0.0", + "lodash.isarray": "^3.0.0" } } diff --git a/lodash.dropwhile/README.md b/lodash.dropwhile/README.md index 4054dbb37..674dae23e 100644 --- a/lodash.dropwhile/README.md +++ b/lodash.dropwhile/README.md @@ -1,4 +1,4 @@ -# lodash.dropwhile v3.0.1 +# lodash.dropwhile v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.dropWhile` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var dropWhile = require('lodash.dropwhile'); ``` -See the [documentation](https://lodash.com/docs#dropWhile) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.dropwhile) for more details. +See the [documentation](https://lodash.com/docs#dropWhile) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.dropwhile) for more details. diff --git a/lodash.dropwhile/index.js b/lodash.dropwhile/index.js index 458b3d098..8e450f01a 100644 --- a/lodash.dropwhile/index.js +++ b/lodash.dropwhile/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.2 @@ -7,7 +7,8 @@ * Available under MIT license */ var baseCallback = require('lodash._basecallback'), - baseSlice = require('lodash._baseslice'); + baseSlice = require('lodash._baseslice'), + isArray = require('lodash.isarray'); /** * The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`, diff --git a/lodash.dropwhile/package.json b/lodash.dropwhile/package.json index 85a8468cb..024a31789 100644 --- a/lodash.dropwhile/package.json +++ b/lodash.dropwhile/package.json @@ -1,6 +1,6 @@ { "name": "lodash.dropwhile", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s `_.dropWhile` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,6 +18,7 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._basecallback": "^3.0.0", - "lodash._baseslice": "^3.0.0" + "lodash._baseslice": "^3.0.0", + "lodash.isarray": "^3.0.0" } } diff --git a/lodash.memoize/LICENSE.txt b/lodash.endswith/LICENSE similarity index 89% rename from lodash.memoize/LICENSE.txt rename to lodash.endswith/LICENSE index 9cd87e5dc..b054ca5a3 100644 --- a/lodash.memoize/LICENSE.txt +++ b/lodash.endswith/LICENSE @@ -1,5 +1,5 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.endswith/README.md b/lodash.endswith/README.md index 11e270b74..10b6abcbe 100644 --- a/lodash.endswith/README.md +++ b/lodash.endswith/README.md @@ -1,20 +1,18 @@ -# lodash.endswith v3.0.2 +# lodash.endswith v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.endsWith` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.endsWith` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.endswith ``` -In Node.js/io.js: - +In Node.js: ```js var endsWith = require('lodash.endswith'); ``` -See the [documentation](https://lodash.com/docs#endsWith) or [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash.endswith) for more details. +See the [documentation](https://lodash.com/docs#endsWith) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.endswith) for more details. diff --git a/lodash.endswith/index.js b/lodash.endswith/index.js index 794c1d1ed..ca91525f3 100644 --- a/lodash.endswith/index.js +++ b/lodash.endswith/index.js @@ -1,15 +1,284 @@ /** - * lodash 3.0.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseToString = require('lodash._basetostring'); -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + symbolTag = '[object Symbol]'; + +/** 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 `global`. */ +var freeParseInt = parseInt; + +/** Used for built-in method references. */ +var objectProto = global.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 value references. */ +var _Symbol = global.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = _Symbol ? _Symbol.prototype : undefined, + symbolToString = _Symbol ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.clamp` which doesn't coerce arguments to numbers. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ +function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; +} + +/** + * 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 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) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * 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 _ + * @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 _ + * @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); +} + +/** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ +function toInteger(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + var remainder = value % 1; + return value === value ? (remainder ? value - remainder : value) : 0; +} + +/** + * 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); +} + +/** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return _Symbol ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} /** * Checks if `string` ends with the given target string. @@ -33,13 +302,13 @@ var nativeMin = Math.min; * // => true */ function endsWith(string, target, position) { - string = baseToString(string); - target = (target + ''); + string = toString(string); + target = typeof target == 'string' ? target : (target + ''); var length = string.length; position = position === undefined ? length - : nativeMin(position < 0 ? 0 : (+position || 0), length); + : baseClamp(toInteger(position), 0, length); position -= target.length; return position >= 0 && string.indexOf(target, position) == position; diff --git a/lodash.endswith/package.json b/lodash.endswith/package.json index 30f74a0a7..59d44fd04 100644 --- a/lodash.endswith/package.json +++ b/lodash.endswith/package.json @@ -1,22 +1,17 @@ { "name": "lodash.endswith", - "version": "3.0.2", - "description": "The modern build of lodash’s `_.endsWith` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.endsWith` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, endswith", "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", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "dependencies": { - "lodash._basetostring": "^3.0.0" - } + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } } diff --git a/lodash.startswith/LICENSE.txt b/lodash.escape/LICENSE similarity index 89% rename from lodash.startswith/LICENSE.txt rename to lodash.escape/LICENSE index 9cd87e5dc..b054ca5a3 100644 --- a/lodash.startswith/LICENSE.txt +++ b/lodash.escape/LICENSE @@ -1,5 +1,5 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.escape/README.md b/lodash.escape/README.md index 558476ffe..b86621fa3 100644 --- a/lodash.escape/README.md +++ b/lodash.escape/README.md @@ -1,20 +1,18 @@ -# lodash.escape v3.0.0 +# lodash.escape v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.escape` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.escape` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.escape ``` -In Node.js/io.js: - +In Node.js: ```js var escape = require('lodash.escape'); ``` -See the [documentation](https://lodash.com/docs#escape) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.escape) for more details. +See the [documentation](https://lodash.com/docs#escape) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.escape) for more details. diff --git a/lodash.escape/index.js b/lodash.escape/index.js index 04bc91fff..500cb7c15 100644 --- a/lodash.escape/index.js +++ b/lodash.escape/index.js @@ -1,12 +1,17 @@ /** - * lodash 3.0.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseToString = require('lodash._basetostring'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; /** Used to match HTML entities and HTML characters. */ var reUnescapedHtml = /[&<>"'`]/g, @@ -33,12 +38,111 @@ function escapeHtmlChar(chr) { return htmlEscapes[chr]; } +/** Used for built-in method references. */ +var objectProto = global.Object.prototype; + /** - * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string` to + * 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 value references. */ +var _Symbol = global.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = _Symbol ? _Symbol.prototype : undefined, + symbolToString = _Symbol ? symbolProto.toString : undefined; + +/** + * 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 _ + * @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 _ + * @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); +} + +/** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return _Symbol ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to * their corresponding HTML entities. * - * **Note:** No other characters are escaped. To escape additional characters - * use a third-party library like [_he_](https://mths.be/he). + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). * * Though the ">" character is escaped for symmetry, characters like * ">" and "/" don't need escaping in HTML and have no special meaning @@ -46,8 +150,8 @@ function escapeHtmlChar(chr) { * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) * (under "semi-related fun fact") for more details. * - * Backticks are escaped because in Internet Explorer < 9, they can break out - * of attribute values or HTML comments. See [#59](https://html5sec.org/#59), + * Backticks are escaped because in IE < 9, they can break out of + * attribute values or HTML comments. See [#59](https://html5sec.org/#59), * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/) * for more details. @@ -66,8 +170,7 @@ function escapeHtmlChar(chr) { * // => 'fred, barney, & pebbles' */ function escape(string) { - // Reset `lastIndex` because in IE < 9 `String#replace` does not. - string = baseToString(string); + string = toString(string); return (string && reHasUnescapedHtml.test(string)) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; diff --git a/lodash.escape/package.json b/lodash.escape/package.json index 5c248b2df..c939cf4cd 100644 --- a/lodash.escape/package.json +++ b/lodash.escape/package.json @@ -1,22 +1,17 @@ { "name": "lodash.escape", - "version": "3.0.0", - "description": "The modern build of lodash’s `_.escape` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.escape` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, escape", "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", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "dependencies": { - "lodash._basetostring": "^3.0.0" - } + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } } diff --git a/lodash.every/LICENSE.txt b/lodash.every/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.every/LICENSE.txt +++ b/lodash.every/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.every/README.md b/lodash.every/README.md index 7b133e741..d1bc560b3 100644 --- a/lodash.every/README.md +++ b/lodash.every/README.md @@ -1,4 +1,4 @@ -# lodash.every v3.0.0 +# lodash.every v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.every` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var every = require('lodash.every'); ``` -See the [documentation](https://lodash.com/docs#every) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.every) for more details. +See the [documentation](https://lodash.com/docs#every) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.every) for more details. diff --git a/lodash.every/index.js b/lodash.every/index.js index 046ac0169..65319bab7 100644 --- a/lodash.every/index.js +++ b/lodash.every/index.js @@ -1,19 +1,20 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var arrayEvery = require('lodash._arrayevery'), baseCallback = require('lodash._basecallback'), baseEach = require('lodash._baseeach'), + isIterateeCall = require('lodash._isiterateecall'), isArray = require('lodash.isarray'); /** * The base implementation of `_.every` without support for callback - * shorthands or `this` binding. + * shorthands and `this` binding. * * @private * @param {Array|Object|string} collection The collection to iterate over. @@ -32,7 +33,7 @@ function baseEvery(collection, predicate) { /** * Checks if `predicate` returns truthy for **all** elements of `collection`. - * The predicate is bound to `thisArg` and invoked with three arguments; + * The predicate is bound to `thisArg` and invoked with three arguments: * (value, index|key, collection). * * If a property name is provided for `predicate` the created `_.property` @@ -80,6 +81,9 @@ function baseEvery(collection, predicate) { */ function every(collection, predicate, thisArg) { var func = isArray(collection) ? arrayEvery : baseEvery; + if (thisArg && isIterateeCall(collection, predicate, thisArg)) { + predicate = null; + } if (typeof predicate != 'function' || typeof thisArg != 'undefined') { predicate = baseCallback(predicate, thisArg, 3); } diff --git a/lodash.every/package.json b/lodash.every/package.json index bbb29d4d2..d11bac83f 100644 --- a/lodash.every/package.json +++ b/lodash.every/package.json @@ -1,6 +1,6 @@ { "name": "lodash.every", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.every` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -20,6 +20,7 @@ "lodash._arrayevery": "^3.0.0", "lodash._basecallback": "^3.0.0", "lodash._baseeach": "^3.0.0", + "lodash._isiterateecall": "^3.0.0", "lodash.isarray": "^3.0.0" } } diff --git a/lodash.filter/LICENSE.txt b/lodash.filter/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.filter/LICENSE.txt +++ b/lodash.filter/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.filter/README.md b/lodash.filter/README.md index 52862d0b0..c9543d687 100644 --- a/lodash.filter/README.md +++ b/lodash.filter/README.md @@ -1,4 +1,4 @@ -# lodash.filter v3.0.0 +# lodash.filter v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.filter` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var filter = require('lodash.filter'); ``` -See the [documentation](https://lodash.com/docs#filter) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.filter) for more details. +See the [documentation](https://lodash.com/docs#filter) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.filter) for more details. diff --git a/lodash.filter/index.js b/lodash.filter/index.js index 8278f47c4..3853fd58e 100644 --- a/lodash.filter/index.js +++ b/lodash.filter/index.js @@ -1,15 +1,16 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var arrayFilter = require('lodash._arrayfilter'), baseCallback = require('lodash._basecallback'), baseFilter = require('lodash._basefilter'), - isArray = require('lodash.isarray'); + isArray = require('lodash.isarray'), + keys = require('lodash.keys'); /** * Iterates over elements of `collection`, returning an array of all elements diff --git a/lodash.filter/package.json b/lodash.filter/package.json index 7283df1e1..21fae36fb 100644 --- a/lodash.filter/package.json +++ b/lodash.filter/package.json @@ -1,6 +1,6 @@ { "name": "lodash.filter", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.filter` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -20,6 +20,7 @@ "lodash._arrayfilter": "^3.0.0", "lodash._basecallback": "^3.0.0", "lodash._basefilter": "^3.0.0", - "lodash.isarray": "^3.0.0" + "lodash.isarray": "^3.0.0", + "lodash.keys": "^3.0.0" } } diff --git a/lodash.find/LICENSE.txt b/lodash.find/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.find/LICENSE.txt +++ b/lodash.find/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.find/README.md b/lodash.find/README.md index e6eb0c168..05f898af4 100644 --- a/lodash.find/README.md +++ b/lodash.find/README.md @@ -1,4 +1,4 @@ -# lodash.find v3.0.0 +# lodash.find v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.find` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var find = require('lodash.find'); ``` -See the [documentation](https://lodash.com/docs#find) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.find) for more details. +See the [documentation](https://lodash.com/docs#find) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.find) for more details. diff --git a/lodash.find/index.js b/lodash.find/index.js index 133544fa4..6768f93a4 100644 --- a/lodash.find/index.js +++ b/lodash.find/index.js @@ -1,21 +1,40 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseCallback = require('lodash._basecallback'), baseEach = require('lodash._baseeach'), baseFind = require('lodash._basefind'), - findIndex = require('lodash.findindex'), + baseFindIndex = require('lodash._basefindindex'), isArray = require('lodash.isarray'); +/** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new find function. + */ +function createFind(eachFunc, fromRight) { + return function(collection, predicate, thisArg) { + predicate = baseCallback(predicate, thisArg, 3); + if (isArray(collection)) { + var index = baseFindIndex(collection, predicate, fromRight); + return index > -1 ? collection[index] : undefined; + } + return baseFind(collection, predicate, eachFunc); + } +} + /** * Iterates over elements of `collection`, returning the first element * `predicate` returns truthy for. The predicate is bound to `thisArg` and - * invoked with three arguments; (value, index|key, collection). + * invoked with three arguments: (value, index|key, collection). * * If a property name is provided for `predicate` the created `_.property` * style callback returns the property value of the given element. @@ -62,13 +81,6 @@ var baseCallback = require('lodash._basecallback'), * _.result(_.find(users, 'active'), 'user'); * // => 'barney' */ -function find(collection, predicate, thisArg) { - if (isArray(collection)) { - var index = findIndex(collection, predicate, thisArg); - return index > -1 ? collection[index] : undefined; - } - predicate = baseCallback(predicate, thisArg, 3); - return baseFind(collection, predicate, baseEach); -} +var find = createFind(baseEach); module.exports = find; diff --git a/lodash.find/package.json b/lodash.find/package.json index 92fb38f0a..579ea14e7 100644 --- a/lodash.find/package.json +++ b/lodash.find/package.json @@ -1,6 +1,6 @@ { "name": "lodash.find", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.find` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -20,7 +20,7 @@ "lodash._basecallback": "^3.0.0", "lodash._baseeach": "^3.0.0", "lodash._basefind": "^3.0.0", - "lodash.findindex": "^3.0.0", + "lodash._basefindindex": "^3.0.0", "lodash.isarray": "^3.0.0" } } diff --git a/lodash.findindex/LICENSE.txt b/lodash.findindex/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.findindex/LICENSE.txt +++ b/lodash.findindex/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.findindex/README.md b/lodash.findindex/README.md index 29cfb6012..3ec1fd250 100644 --- a/lodash.findindex/README.md +++ b/lodash.findindex/README.md @@ -1,4 +1,4 @@ -# lodash.findindex v3.0.0 +# lodash.findindex v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.findIndex` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var findIndex = require('lodash.findindex'); ``` -See the [documentation](https://lodash.com/docs#findIndex) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.findindex) for more details. +See the [documentation](https://lodash.com/docs#findIndex) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.findindex) for more details. diff --git a/lodash.findindex/index.js b/lodash.findindex/index.js index 47402a0fd..e9669fd52 100644 --- a/lodash.findindex/index.js +++ b/lodash.findindex/index.js @@ -1,16 +1,34 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseCallback = require('lodash._basecallback'); +var baseCallback = require('lodash._basecallback'), + baseFindIndex = require('lodash._basefindindex'); + +/** + * Creates a `_.findIndex` or `_.findLastIndex` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new find function. + */ +function createFindIndex(fromRight) { + return function(array, predicate, thisArg) { + if (!(array && array.length)) { + return -1; + } + predicate = baseCallback(predicate, thisArg, 3); + return baseFindIndex(array, predicate, fromRight); + }; +} /** * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for, instead of the element itself. + * element `predicate` returns truthy for instead of the element itself. * * If a property name is provided for `predicate` the created `_.property` * style callback returns the property value of the given element. @@ -56,17 +74,6 @@ var baseCallback = require('lodash._basecallback'); * _.findIndex(users, 'active'); * // => 2 */ -function findIndex(array, predicate, thisArg) { - var index = -1, - length = array ? array.length : 0; - - predicate = baseCallback(predicate, thisArg, 3); - while (++index < length) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; -} +var findIndex = createFindIndex(); module.exports = findIndex; diff --git a/lodash.findindex/package.json b/lodash.findindex/package.json index 1a5cce694..c8df1cf89 100644 --- a/lodash.findindex/package.json +++ b/lodash.findindex/package.json @@ -1,6 +1,6 @@ { "name": "lodash.findindex", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.findIndex` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,7 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._basecallback": "^3.0.0" + "lodash._basecallback": "^3.0.0", + "lodash._basefindindex": "^3.0.0" } } diff --git a/lodash.findlast/LICENSE.txt b/lodash.findlast/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.findlast/LICENSE.txt +++ b/lodash.findlast/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.findlast/README.md b/lodash.findlast/README.md index 77826aa6d..487639f00 100644 --- a/lodash.findlast/README.md +++ b/lodash.findlast/README.md @@ -1,4 +1,4 @@ -# lodash.findlast v3.0.0 +# lodash.findlast v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.findLast` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var findLast = require('lodash.findlast'); ``` -See the [documentation](https://lodash.com/docs#findLast) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.findlast) for more details. +See the [documentation](https://lodash.com/docs#findLast) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.findlast) for more details. diff --git a/lodash.findlast/index.js b/lodash.findlast/index.js index ec03202ad..2cfdf0f5e 100644 --- a/lodash.findlast/index.js +++ b/lodash.findlast/index.js @@ -1,14 +1,35 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseCallback = require('lodash._basecallback'), baseEachRight = require('lodash._baseeachright'), - baseFind = require('lodash._basefind'); + baseFind = require('lodash._basefind'), + baseFindIndex = require('lodash._basefindindex'), + isArray = require('lodash.isarray'); + +/** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new find function. + */ +function createFind(eachFunc, fromRight) { + return function(collection, predicate, thisArg) { + predicate = baseCallback(predicate, thisArg, 3); + if (isArray(collection)) { + var index = baseFindIndex(collection, predicate, fromRight); + return index > -1 ? collection[index] : undefined; + } + return baseFind(collection, predicate, eachFunc); + } +} /** * This method is like `_.find` except that it iterates over elements of @@ -29,9 +50,6 @@ var baseCallback = require('lodash._basecallback'), * }); * // => 3 */ -function findLast(collection, predicate, thisArg) { - predicate = baseCallback(predicate, thisArg, 3); - return baseFind(collection, predicate, baseEachRight); -} +var findLast = createFind(baseEachRight, true); module.exports = findLast; diff --git a/lodash.findlast/package.json b/lodash.findlast/package.json index 67794a130..3bb30b3c8 100644 --- a/lodash.findlast/package.json +++ b/lodash.findlast/package.json @@ -1,6 +1,6 @@ { "name": "lodash.findlast", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.findLast` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -19,6 +19,8 @@ "dependencies": { "lodash._basecallback": "^3.0.0", "lodash._baseeachright": "^3.0.0", - "lodash._basefind": "^3.0.0" + "lodash._basefind": "^3.0.0", + "lodash._basefindindex": "^3.0.0", + "lodash.isarray": "^3.0.0" } } diff --git a/lodash.findlastindex/LICENSE.txt b/lodash.findlastindex/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.findlastindex/LICENSE.txt +++ b/lodash.findlastindex/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.findlastindex/README.md b/lodash.findlastindex/README.md index 6ea51e281..471c0adec 100644 --- a/lodash.findlastindex/README.md +++ b/lodash.findlastindex/README.md @@ -1,4 +1,4 @@ -# lodash.findlastindex v3.0.0 +# lodash.findlastindex v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.findLastIndex` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var findLastIndex = require('lodash.findlastindex'); ``` -See the [documentation](https://lodash.com/docs#findLastIndex) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.findlastindex) for more details. +See the [documentation](https://lodash.com/docs#findLastIndex) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.findlastindex) for more details. diff --git a/lodash.findlastindex/index.js b/lodash.findlastindex/index.js index 99c3f7278..b3ac91088 100644 --- a/lodash.findlastindex/index.js +++ b/lodash.findlastindex/index.js @@ -1,12 +1,30 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseCallback = require('lodash._basecallback'); +var baseCallback = require('lodash._basecallback'), + baseFindIndex = require('lodash._basefindindex'); + +/** + * Creates a `_.findIndex` or `_.findLastIndex` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new find function. + */ +function createFindIndex(fromRight) { + return function(array, predicate, thisArg) { + if (!(array && array.length)) { + return -1; + } + predicate = baseCallback(predicate, thisArg, 3); + return baseFindIndex(array, predicate, fromRight); + }; +} /** * This method is like `_.findIndex` except that it iterates over elements @@ -56,15 +74,6 @@ var baseCallback = require('lodash._basecallback'); * _.findLastIndex(users, 'active'); * // => 0 */ -function findLastIndex(array, predicate, thisArg) { - var length = array ? array.length : 0; - predicate = baseCallback(predicate, thisArg, 3); - while (length--) { - if (predicate(array[length], length, array)) { - return length; - } - } - return -1; -} +var findLastIndex = createFindIndex(true); module.exports = findLastIndex; diff --git a/lodash.findlastindex/package.json b/lodash.findlastindex/package.json index fc733d561..0083bcd71 100644 --- a/lodash.findlastindex/package.json +++ b/lodash.findlastindex/package.json @@ -1,6 +1,6 @@ { "name": "lodash.findlastindex", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.findLastIndex` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,7 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._basecallback": "^3.0.0" + "lodash._basecallback": "^3.0.0", + "lodash._basefindindex": "^3.0.0" } } diff --git a/lodash.findwhere/README.md b/lodash.findwhere/README.md index fa387405d..671d6f4c9 100644 --- a/lodash.findwhere/README.md +++ b/lodash.findwhere/README.md @@ -1,4 +1,4 @@ -# lodash.findwhere v3.0.0 +# lodash.findwhere v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.findWhere` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var findWhere = require('lodash.findwhere'); ``` -See the [documentation](https://lodash.com/docs#findWhere) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.findwhere) for more details. +See the [documentation](https://lodash.com/docs#findWhere) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.findwhere) for more details. diff --git a/lodash.findwhere/index.js b/lodash.findwhere/index.js index a845b0c0a..735cf374a 100644 --- a/lodash.findwhere/index.js +++ b/lodash.findwhere/index.js @@ -1,127 +1,24 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.7.0 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseClone = require('lodash._baseclone'), - baseIsEqual = require('lodash._baseisequal'), - find = require('lodash.find'), - keys = require('lodash.keys'); - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * The base implementation of `_.isMatch` without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Object} source The object to inspect. - * @param {Array} props The source property names to match. - * @param {Array} values The source values to match. - * @param {Array} strictCompareFlags Strict comparison flags for source values. - * @param {Function} [customizer] The function to customize comparing objects. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ -function baseIsMatch(object, props, values, strictCompareFlags, customizer) { - var length = props.length; - if (object == null) { - return !length; - } - var index = -1, - noCustomizer = !customizer; - - while (++index < length) { - if ((noCustomizer && strictCompareFlags[index]) - ? values[index] !== object[props[index]] - : !hasOwnProperty.call(object, props[index]) - ) { - return false; - } - } - index = -1; - while (++index < length) { - var key = props[index]; - if (noCustomizer && strictCompareFlags[index]) { - var result = hasOwnProperty.call(object, key); - } else { - var objValue = object[key], - srcValue = values[index]; - - result = customizer ? customizer(objValue, srcValue, key) : undefined; - if (typeof result == 'undefined') { - result = baseIsEqual(srcValue, objValue, customizer, true); - } - } - if (!result) { - return false; - } - } - return true; -} - -/** - * The base implementation of `_.matches` which supports specifying whether - * `source` should be cloned. - * - * @private - * @param {Object} source The object of property values to match. - * @param {boolean} [isCloned] Specify cloning the source object. - * @returns {Function} Returns the new function. - */ -function baseMatches(source, isCloned) { - var props = keys(source), - length = props.length; - - if (length == 1) { - var key = props[0], - value = source[key]; - - if (isStrictComparable(value)) { - return function(object) { - return object != null && value === object[key] && hasOwnProperty.call(object, key); - }; - } - } - if (isCloned) { - source = baseClone(source, true); - } - var values = Array(length), - strictCompareFlags = Array(length); - - while (length--) { - value = source[props[length]]; - values[length] = value; - strictCompareFlags[length] = isStrictComparable(value); - } - return function(object) { - return baseIsMatch(object, props, values, strictCompareFlags); - }; -} - -/** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ -function isStrictComparable(value) { - return value === value && (value === 0 ? ((1 / value) > 0) : !isObject(value)); -} +var baseMatches = require('lodash._basematches'), + find = require('lodash.find'); /** * Performs a deep comparison between each element in `collection` and the * source object, returning the first element that has equivalent property * values. * + * **Note:** This method supports comparing arrays, booleans, `Date` objects, + * numbers, `Object` objects, regexes, and strings. Objects are compared by + * their own, not inherited, enumerable properties. For comparing a single + * own or inherited property value see `_.matchesProperty`. + * * @static * @memberOf _ * @category Collection @@ -131,76 +28,18 @@ function isStrictComparable(value) { * @example * * var users = [ - * { 'user': 'barney', 'age': 36, 'status': 'busy' }, - * { 'user': 'fred', 'age': 40, 'status': 'busy' } + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } * ]; * - * _.result(_.findWhere(users, { 'status': 'busy' }), 'user'); + * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user'); * // => 'barney' * - * _.result(_.findWhere(users, { 'age': 40 }), 'user'); + * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user'); * // => 'fred' */ function findWhere(collection, source) { - return find(collection, matches(source)); -} - -/** - * Checks if `value` is the language type of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * **Note:** See the [ES5 spec](https://es5.github.io/#x8) for more details. - * - * @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(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return type == 'function' || (value && type == 'object') || false; -} - -/** - * Creates a function which performs a deep comparison between a given object - * and `source`, returning `true` if the given object has equivalent property - * values, else `false`. - * - * @static - * @memberOf _ - * @category Utility - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * var matchesAge = _.matches({ 'age': 36 }); - * - * _.filter(users, matchesAge); - * // => [{ 'user': 'barney', 'age': 36 }] - * - * _.find(users, matchesAge); - * // => { 'user': 'barney', 'age': 36 } - */ -function matches(source) { - return baseMatches(source, true); + return find(collection, baseMatches(source)); } module.exports = findWhere; diff --git a/lodash.findwhere/package.json b/lodash.findwhere/package.json index 2071abcaa..302a7fe1f 100644 --- a/lodash.findwhere/package.json +++ b/lodash.findwhere/package.json @@ -1,6 +1,6 @@ { "name": "lodash.findwhere", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.findWhere` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,9 +17,7 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._baseclone": "^3.0.0", - "lodash._baseisequal": "^3.0.0", - "lodash.find": "^3.0.0", - "lodash.keys": "^3.0.0" + "lodash._basematches": "^3.0.0", + "lodash.find": "^3.0.0" } } diff --git a/lodash.flow/README.md b/lodash.flow/README.md index 0e7bc739f..0643da91b 100644 --- a/lodash.flow/README.md +++ b/lodash.flow/README.md @@ -1,4 +1,4 @@ -# lodash.flow v3.0.2 +# lodash.flow v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.flow` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var flow = require('lodash.flow'); ``` -See the [documentation](https://lodash.com/docs#flow) or [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash.flow) for more details. +See the [documentation](https://lodash.com/docs#flow) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.flow) for more details. diff --git a/lodash.flow/index.js b/lodash.flow/index.js index 9517f39fd..95348308e 100644 --- a/lodash.flow/index.js +++ b/lodash.flow/index.js @@ -1,29 +1,12 @@ /** - * lodash 3.0.2 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var arrayEvery = require('lodash._arrayevery'); - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * The base implementation of `_.isFunction` without support for environments - * with incorrect `typeof` results. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - */ -function baseIsFunction(value) { - // Avoid a Chakra JIT bug in compatibility modes of IE 11. - // See https://github.com/jashkenas/underscore/issues/1621 for more details. - return typeof value == 'function' || false; -} +var createComposer = require('lodash._createcomposer'); /** * Creates a function that returns the result of invoking the provided @@ -45,25 +28,6 @@ function baseIsFunction(value) { * addSquare(1, 2); * // => 9 */ -function flow() { - var funcs = arguments, - length = funcs.length; - - if (!length) { - return function() { return arguments[0]; }; - } - if (!arrayEvery(funcs, baseIsFunction)) { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - var index = 0, - result = funcs[index].apply(this, arguments); - - while (++index < length) { - result = funcs[index].call(this, result); - } - return result; - }; -} +var flow = createComposer(); module.exports = flow; diff --git a/lodash.flow/package.json b/lodash.flow/package.json index 4d184dd09..db1bbd8a1 100644 --- a/lodash.flow/package.json +++ b/lodash.flow/package.json @@ -1,6 +1,6 @@ { "name": "lodash.flow", - "version": "3.0.2", + "version": "3.1.0", "description": "The modern build of lodash’s `_.flow` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,6 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._arrayevery": "^3.0.0" + "lodash._createcomposer": "^3.0.0" } } diff --git a/lodash.flowright/README.md b/lodash.flowright/README.md index 4af3fc6c5..b34ae4e24 100644 --- a/lodash.flowright/README.md +++ b/lodash.flowright/README.md @@ -1,4 +1,4 @@ -# lodash.flowright v3.0.2 +# lodash.flowright v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.flowRight` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var flowRight = require('lodash.flowright'); ``` -See the [documentation](https://lodash.com/docs#flowRight) or [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash.flowright) for more details. +See the [documentation](https://lodash.com/docs#flowRight) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.flowright) for more details. diff --git a/lodash.flowright/index.js b/lodash.flowright/index.js index 4d6162dfb..c6da631a9 100644 --- a/lodash.flowright/index.js +++ b/lodash.flowright/index.js @@ -1,29 +1,12 @@ /** - * lodash 3.0.2 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var arrayEvery = require('lodash._arrayevery'); - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * The base implementation of `_.isFunction` without support for environments - * with incorrect `typeof` results. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - */ -function baseIsFunction(value) { - // Avoid a Chakra JIT bug in compatibility modes of IE 11. - // See https://github.com/jashkenas/underscore/issues/1621 for more details. - return typeof value == 'function' || false; -} +var createComposer = require('lodash._createcomposer'); /** * This method is like `_.flow` except that it creates a function that @@ -45,25 +28,6 @@ function baseIsFunction(value) { * addSquare(1, 2); * // => 9 */ -function flowRight() { - var funcs = arguments, - fromIndex = funcs.length - 1; - - if (fromIndex < 0) { - return function() { return arguments[0]; }; - } - if (!arrayEvery(funcs, baseIsFunction)) { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - var index = fromIndex, - result = funcs[index].apply(this, arguments); - - while (index--) { - result = funcs[index].call(this, result); - } - return result; - }; -} +var flowRight = createComposer(true); module.exports = flowRight; diff --git a/lodash.flowright/package.json b/lodash.flowright/package.json index e39141daf..74bf70702 100644 --- a/lodash.flowright/package.json +++ b/lodash.flowright/package.json @@ -1,6 +1,6 @@ { "name": "lodash.flowright", - "version": "3.0.2", + "version": "3.1.0", "description": "The modern build of lodash’s `_.flowRight` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,6 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._arrayevery": "^3.0.0" + "lodash._createcomposer": "^3.0.0" } } diff --git a/lodash.groupby/LICENSE.txt b/lodash.groupby/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.groupby/LICENSE.txt +++ b/lodash.groupby/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.groupby/README.md b/lodash.groupby/README.md index 4b2212afb..d53fc59b4 100644 --- a/lodash.groupby/README.md +++ b/lodash.groupby/README.md @@ -1,4 +1,4 @@ -# lodash.groupby v3.0.0 +# lodash.groupby v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.groupBy` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var groupBy = require('lodash.groupby'); ``` -See the [documentation](https://lodash.com/docs#groupBy) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.groupby) for more details. +See the [documentation](https://lodash.com/docs#groupBy) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.groupby) for more details. diff --git a/lodash.groupby/index.js b/lodash.groupby/index.js index f591f466b..6033d3f3c 100644 --- a/lodash.groupby/index.js +++ b/lodash.groupby/index.js @@ -1,12 +1,13 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var createAggregator = require('lodash._createaggregator'); +var createAggregator = require('lodash._createaggregator'), + keys = require('lodash.keys'); /** Used for native method references. */ var objectProto = Object.prototype; diff --git a/lodash.groupby/package.json b/lodash.groupby/package.json index 3b56fcccb..117136bc7 100644 --- a/lodash.groupby/package.json +++ b/lodash.groupby/package.json @@ -1,6 +1,6 @@ { "name": "lodash.groupby", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.groupBy` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,7 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._createaggregator": "^3.0.0" + "lodash._createaggregator": "^3.0.0", + "lodash.keys": "^3.0.0" } } diff --git a/lodash.has/LICENSE.txt b/lodash.has/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.has/LICENSE.txt +++ b/lodash.has/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.has/README.md b/lodash.has/README.md index 2df38b8db..d88c0a0e0 100644 --- a/lodash.has/README.md +++ b/lodash.has/README.md @@ -1,4 +1,4 @@ -# lodash.has v3.0.0 +# lodash.has v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.has` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var has = require('lodash.has'); ``` -See the [documentation](https://lodash.com/docs#has) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.has) for more details. +See the [documentation](https://lodash.com/docs#has) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.has) for more details. diff --git a/lodash.has/index.js b/lodash.has/index.js index ef868fc66..283373ab8 100644 --- a/lodash.has/index.js +++ b/lodash.has/index.js @@ -1,11 +1,19 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ +var baseGet = require('lodash._baseget'), + baseSlice = require('lodash._baseslice'), + toPath = require('lodash._topath'), + isArray = require('lodash.isarray'); + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]+|(["'])(?:(?!\1)[^\n\\]|\\.)*?)\1\]/, + reIsPlainProp = /^\w*$/; /** Used for native method references. */ var objectProto = Object.prototype; @@ -14,24 +22,115 @@ var objectProto = Object.prototype; var hasOwnProperty = objectProto.hasOwnProperty; /** - * Checks if `key` exists as a direct property of `object` instead of an - * inherited property. + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + var type = typeof value; + if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { + return true; + } + if (isArray(value)) { + return false; + } + var result = !reIsDeepProp.test(value); + return result || (object != null && value in toObject(object)); +} + +/** + * Converts `value` to an object if it is not one. + * + * @private + * @param {*} value The value to process. + * @returns {Object} Returns the object. + */ +function toObject(value) { + return isObject(value) ? value : Object(value); +} + +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array ? array.length : 0; + return length ? array[length - 1] : undefined; +} + +/** + * 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(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return type == 'function' || (!!value && type == 'object'); +} + +/** + * Checks if `path` is a direct property. * * @static * @memberOf _ * @category Object - * @param {Object} object The object to inspect. - * @param {string} key The key to check. - * @returns {boolean} Returns `true` if `key` is a direct property, else `false`. + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` is a direct property, else `false`. * @example * - * var object = { 'a': 1, 'b': 2, 'c': 3 }; + * var object = { 'a': { 'b': { 'c': 3 } } }; * - * _.has(object, 'b'); + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b.c'); + * // => true + * + * _.has(object, ['a', 'b', 'c']); * // => true */ -function has(object, key) { - return object ? hasOwnProperty.call(object, key) : false; +function has(object, path) { + if (object == null) { + return false; + } + var result = hasOwnProperty.call(object, path); + if (!result && !isKey(path)) { + path = toPath(path); + object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); + path = last(path); + result = object != null && hasOwnProperty.call(object, path); + } + return result; } module.exports = has; diff --git a/lodash.has/package.json b/lodash.has/package.json index 53955230e..da8960439 100644 --- a/lodash.has/package.json +++ b/lodash.has/package.json @@ -1,6 +1,6 @@ { "name": "lodash.has", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.has` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -15,5 +15,11 @@ "Mathias Bynens (https://mathiasbynens.be/)" ], "repository": "lodash/lodash", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, + "dependencies": { + "lodash._baseget": "^3.0.0", + "lodash._baseslice": "^3.0.0", + "lodash._topath": "^3.0.0", + "lodash.isarray": "^3.0.0" + } } diff --git a/lodash.includes/LICENSE.txt b/lodash.includes/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.includes/LICENSE.txt +++ b/lodash.includes/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.includes/README.md b/lodash.includes/README.md index 123f35906..5323c151f 100644 --- a/lodash.includes/README.md +++ b/lodash.includes/README.md @@ -1,4 +1,4 @@ -# lodash.includes v3.0.0 +# lodash.includes v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.includes` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var includes = require('lodash.includes'); ``` -See the [documentation](https://lodash.com/docs#includes) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.includes) for more details. +See the [documentation](https://lodash.com/docs#includes) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.includes) for more details. diff --git a/lodash.includes/index.js b/lodash.includes/index.js index ed4c3b499..81822cdf8 100644 --- a/lodash.includes/index.js +++ b/lodash.includes/index.js @@ -1,13 +1,14 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseIndexOf = require('lodash._baseindexof'), baseValues = require('lodash._basevalues'), + isIterateeCall = require('lodash._isiterateecall'), isArray = require('lodash.isarray'), isString = require('lodash.isstring'), keys = require('lodash.keys'); @@ -16,18 +17,15 @@ var baseIndexOf = require('lodash._baseindexof'), var nativeMax = Math.max; /** - * Used as the maximum length of an array-like value. - * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) - * for more details. + * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) + * of an array-like value. */ var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; /** * Checks if `value` is a valid array-like length. * - * **Note:** This function is based on ES `ToLength`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) - * for more details. + * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). * * @private * @param {*} value The value to check. @@ -42,10 +40,9 @@ function isLength(value) { * comparisons. If `fromIndex` is negative, it is used as the offset from * the end of `collection`. * - * **Note:** `SameValueZero` comparisons are like strict equality comparisons, - * e.g. `===`, except that `NaN` matches `NaN`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for more details. + * **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) + * comparisons are like strict equality comparisons, e.g. `===`, except that + * `NaN` matches `NaN`. * * @static * @memberOf _ @@ -54,6 +51,7 @@ function isLength(value) { * @param {Array|Object|string} collection The collection to search. * @param {*} target The value to search for. * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. * @returns {boolean} Returns `true` if a matching element is found, else `false`. * @example * @@ -69,7 +67,7 @@ function isLength(value) { * _.includes('pebbles', 'eb'); * // => true */ -function includes(collection, target, fromIndex) { +function includes(collection, target, fromIndex, guard) { var length = collection ? collection.length : 0; if (!isLength(length)) { collection = values(collection); @@ -78,10 +76,10 @@ function includes(collection, target, fromIndex) { if (!length) { return false; } - if (typeof fromIndex == 'number') { - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0); - } else { + if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) { fromIndex = 0; + } else { + fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0); } return (typeof collection == 'string' || !isArray(collection) && isString(collection)) ? (fromIndex < length && collection.indexOf(target, fromIndex) > -1) diff --git a/lodash.includes/package.json b/lodash.includes/package.json index 690dec74d..2569b1e18 100644 --- a/lodash.includes/package.json +++ b/lodash.includes/package.json @@ -1,6 +1,6 @@ { "name": "lodash.includes", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.includes` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -19,6 +19,7 @@ "dependencies": { "lodash._baseindexof": "^3.0.0", "lodash._basevalues": "^3.0.0", + "lodash._isiterateecall": "^3.0.0", "lodash.isarray": "^3.0.0", "lodash.isstring": "^3.0.0", "lodash.keys": "^3.0.0" diff --git a/lodash.indexby/LICENSE.txt b/lodash.indexby/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.indexby/LICENSE.txt +++ b/lodash.indexby/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.indexby/README.md b/lodash.indexby/README.md index 9797ca76c..94a37274e 100644 --- a/lodash.indexby/README.md +++ b/lodash.indexby/README.md @@ -1,4 +1,4 @@ -# lodash.indexby v3.0.0 +# lodash.indexby v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.indexBy` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var indexBy = require('lodash.indexby'); ``` -See the [documentation](https://lodash.com/docs#indexBy) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.indexby) for more details. +See the [documentation](https://lodash.com/docs#indexBy) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.indexby) for more details. diff --git a/lodash.indexby/index.js b/lodash.indexby/index.js index b298cb512..62bdd0696 100644 --- a/lodash.indexby/index.js +++ b/lodash.indexby/index.js @@ -1,12 +1,13 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var createAggregator = require('lodash._createaggregator'); +var createAggregator = require('lodash._createaggregator'), + keys = require('lodash.keys'); /** * Creates an object composed of keys generated from the results of running diff --git a/lodash.indexby/package.json b/lodash.indexby/package.json index 7f3945ef5..ae9be067d 100644 --- a/lodash.indexby/package.json +++ b/lodash.indexby/package.json @@ -1,6 +1,6 @@ { "name": "lodash.indexby", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.indexBy` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,7 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._createaggregator": "^3.0.0" + "lodash._createaggregator": "^3.0.0", + "lodash.keys": "^3.0.0" } } diff --git a/lodash.intersection/README.md b/lodash.intersection/README.md index 99ac6c357..10c9741ff 100644 --- a/lodash.intersection/README.md +++ b/lodash.intersection/README.md @@ -1,4 +1,4 @@ -# lodash.intersection v3.0.3 +# lodash.intersection v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.intersection` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var intersection = require('lodash.intersection'); ``` -See the [documentation](https://lodash.com/docs#intersection) or [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash.intersection) for more details. +See the [documentation](https://lodash.com/docs#intersection) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.intersection) for more details. diff --git a/lodash.intersection/index.js b/lodash.intersection/index.js index ee2ae5e33..ae2469672 100644 --- a/lodash.intersection/index.js +++ b/lodash.intersection/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.3 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.3 @@ -8,17 +8,67 @@ */ var baseIndexOf = require('lodash._baseindexof'), cacheIndexOf = require('lodash._cacheindexof'), - createCache = require('lodash._createcache'), - isArguments = require('lodash.isarguments'), - isArray = require('lodash.isarray'); + createCache = require('lodash._createcache'); /** - * Creates an array of unique values in all provided arrays using `SameValueZero` - * for equality comparisons. + * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) + * of an array-like value. + */ +var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; + +/** + * The base implementation of `_.property` without support for deep paths. * - * **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * comparisons are like strict equality comparisons, e.g. `===`, except that - * `NaN` matches `NaN`. + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +/** + * Checks if `value` is array-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + */ +function isArrayLike(value) { + return value != null && isLength(getLength(value)); +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Creates an array of unique values in all provided arrays using + * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) + * for equality comparisons. * * @static * @memberOf _ @@ -40,7 +90,7 @@ function intersection() { while (++argsIndex < argsLength) { var value = arguments[argsIndex]; - if (isArray(value) || isArguments(value)) { + if (isArrayLike(value)) { args.push(value); caches.push((isCommon && value.length >= 120) ? createCache(argsIndex && value) : null); } diff --git a/lodash.intersection/package.json b/lodash.intersection/package.json index 6065a427e..41b1eca45 100644 --- a/lodash.intersection/package.json +++ b/lodash.intersection/package.json @@ -1,6 +1,6 @@ { "name": "lodash.intersection", - "version": "3.0.3", + "version": "3.1.0", "description": "The modern build of lodash’s `_.intersection` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -19,8 +19,6 @@ "dependencies": { "lodash._baseindexof": "^3.0.0", "lodash._cacheindexof": "^3.0.0", - "lodash._createcache": "^3.0.0", - "lodash.isarguments": "^3.0.0", - "lodash.isarray": "^3.0.0" + "lodash._createcache": "^3.0.0" } } diff --git a/lodash.invoke/LICENSE.txt b/lodash.invoke/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.invoke/LICENSE.txt +++ b/lodash.invoke/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.invoke/README.md b/lodash.invoke/README.md index bd0a73401..1681d0e12 100644 --- a/lodash.invoke/README.md +++ b/lodash.invoke/README.md @@ -1,4 +1,4 @@ -# lodash.invoke v3.0.0 +# lodash.invoke v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.invoke` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var invoke = require('lodash.invoke'); ``` -See the [documentation](https://lodash.com/docs#invoke) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.invoke) for more details. +See the [documentation](https://lodash.com/docs#invoke) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.invoke) for more details. diff --git a/lodash.invoke/index.js b/lodash.invoke/index.js index 6547783ce..e9f5f217f 100644 --- a/lodash.invoke/index.js +++ b/lodash.invoke/index.js @@ -1,51 +1,24 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseEach = require('lodash._baseeach'), - baseSlice = require('lodash._baseslice'); + restParam = require('lodash.restparam'); /** - * Used as the maximum length of an array-like value. - * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) - * for more details. + * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) + * of an array-like value. */ var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; -/** - * The base implementation of `_.invoke` which requires additional arguments - * to be provided as an array of arguments rather than individually. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|string} methodName The name of the method to invoke or - * the function invoked per iteration. - * @param {Array} [args] The arguments to invoke the method with. - * @returns {Array} Returns the array of results. - */ -function baseInvoke(collection, methodName, args) { - var index = -1, - isFunc = typeof methodName == 'function', - length = collection ? collection.length : 0, - result = isLength(length) ? Array(length) : []; - - baseEach(collection, function(value) { - var func = isFunc ? methodName : (value != null && value[methodName]); - result[++index] = func ? func.apply(value, args) : undefined; - }); - return result; -} - /** * Checks if `value` is a valid array-like length. * - * **Note:** This function is based on ES `ToLength`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) - * for more details. + * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). * * @private * @param {*} value The value to check. @@ -77,8 +50,17 @@ function isLength(value) { * _.invoke([123, 456], String.prototype.split, ''); * // => [['1', '2', '3'], ['4', '5', '6']] */ -function invoke(collection, methodName) { - return baseInvoke(collection, methodName, baseSlice(arguments, 2)); -} +var invoke = restParam(function(collection, methodName, args) { + var index = -1, + isFunc = typeof methodName == 'function', + length = collection ? collection.length : 0, + result = isLength(length) ? Array(length) : []; + + baseEach(collection, function(value) { + var func = isFunc ? methodName : (value != null && value[methodName]); + result[++index] = func ? func.apply(value, args) : undefined; + }); + return result; +}); module.exports = invoke; diff --git a/lodash.invoke/package.json b/lodash.invoke/package.json index 6afcd3cce..f8c589475 100644 --- a/lodash.invoke/package.json +++ b/lodash.invoke/package.json @@ -1,6 +1,6 @@ { "name": "lodash.invoke", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.invoke` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,6 +18,6 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._baseeach": "^3.0.0", - "lodash._baseslice": "^3.0.0" + "lodash.restparam": "^3.0.0" } } diff --git a/lodash.isarguments/README.md b/lodash.isarguments/README.md index 1ab7ec672..eb95fe134 100644 --- a/lodash.isarguments/README.md +++ b/lodash.isarguments/README.md @@ -1,4 +1,4 @@ -# lodash.isarguments v3.0.9 +# lodash.isarguments v3.1.0 The [lodash](https://lodash.com/) method `_.isArguments` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var isArguments = require('lodash.isarguments'); ``` -See the [documentation](https://lodash.com/docs#isArguments) or [package source](https://github.com/lodash/lodash/blob/3.0.9-npm-packages/lodash.isarguments) for more details. +See the [documentation](https://lodash.com/docs#isArguments) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.isarguments) for more details. diff --git a/lodash.isarguments/index.js b/lodash.isarguments/index.js index ac1d00e8e..042dac501 100644 --- a/lodash.isarguments/index.js +++ b/lodash.isarguments/index.js @@ -15,19 +15,6 @@ var argsTag = '[object Arguments]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]'; -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -36,7 +23,7 @@ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -44,19 +31,6 @@ var objectToString = objectProto.toString; /** Built-in value references. */ var propertyIsEnumerable = objectProto.propertyIsEnumerable; -/** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a - * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects - * Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ -var getLength = baseProperty('length'); - /** * Checks if `value` is likely an `arguments` object. * @@ -76,7 +50,7 @@ var getLength = baseProperty('length'); * // => false */ function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); } @@ -107,7 +81,7 @@ function isArguments(value) { * // => false */ function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); + return value != null && isLength(value.length) && !isFunction(value); } /** @@ -158,8 +132,7 @@ function isArrayLikeObject(value) { */ 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. + // in Safari 8-9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } @@ -167,16 +140,15 @@ function isFunction(value) { /** * Checks if `value` is a valid array-like length. * - * **Note:** This function is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); @@ -198,7 +170,7 @@ function isLength(value) { /** * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static diff --git a/lodash.isarguments/package.json b/lodash.isarguments/package.json index 46a5060d8..3d3228026 100644 --- a/lodash.isarguments/package.json +++ b/lodash.isarguments/package.json @@ -1,6 +1,6 @@ { "name": "lodash.isarguments", - "version": "3.0.9", + "version": "3.1.0", "description": "The lodash method `_.isArguments` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", diff --git a/lodash.iserror/LICENSE b/lodash.iserror/LICENSE index b054ca5a3..bcbe13d67 100644 --- a/lodash.iserror/LICENSE +++ b/lodash.iserror/LICENSE @@ -1,22 +1,23 @@ +The MIT License (MIT) + Copyright 2012-2016 The Dojo Foundation Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lodash.iserror/README.md b/lodash.iserror/README.md index ee05575d6..100ab0dff 100644 --- a/lodash.iserror/README.md +++ b/lodash.iserror/README.md @@ -1,4 +1,4 @@ -# lodash.iserror v3.0.3 +# lodash.iserror v3.1.0 The [lodash](https://lodash.com/) method `_.isError` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var isError = require('lodash.iserror'); ``` -See the [documentation](https://lodash.com/docs#isError) or [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash.iserror) for more details. +See the [documentation](https://lodash.com/docs#isError) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.iserror) for more details. diff --git a/lodash.iserror/index.js b/lodash.iserror/index.js index 85f1bbc2f..947e51338 100644 --- a/lodash.iserror/index.js +++ b/lodash.iserror/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.3 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 @@ -37,8 +37,12 @@ var objectToString = objectProto.toString; * // => false */ function isError(value) { - return isObjectLike(value) && - typeof value.message == 'string' && objectToString.call(value) == errorTag; + if (!isObjectLike(value)) { + return false; + } + var Ctor = value.constructor; + return (objectToString.call(value) == errorTag) || + (typeof Ctor == 'function' && objectToString.call(Ctor.prototype) == errorTag); } /** diff --git a/lodash.iserror/package.json b/lodash.iserror/package.json index 1731ac724..af1167071 100644 --- a/lodash.iserror/package.json +++ b/lodash.iserror/package.json @@ -1,6 +1,6 @@ { "name": "lodash.iserror", - "version": "3.0.3", + "version": "3.1.0", "description": "The lodash method `_.isError` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", diff --git a/lodash.isfinite/LICENSE.txt b/lodash.isfinite/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.isfinite/LICENSE.txt +++ b/lodash.isfinite/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.isfinite/README.md b/lodash.isfinite/README.md index 0020f7479..08afaa87d 100644 --- a/lodash.isfinite/README.md +++ b/lodash.isfinite/README.md @@ -1,4 +1,4 @@ -# lodash.isfinite v3.0.0 +# lodash.isfinite v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.isFinite` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var isFinite = require('lodash.isfinite'); ``` -See the [documentation](https://lodash.com/docs#isFinite) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.isfinite) for more details. +See the [documentation](https://lodash.com/docs#isFinite) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.isfinite) for more details. diff --git a/lodash.isfinite/index.js b/lodash.isfinite/index.js index e4d1b6e37..71f4259b8 100644 --- a/lodash.isfinite/index.js +++ b/lodash.isfinite/index.js @@ -1,16 +1,16 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var isNative = require('lodash.isnative'); +var getNative = require('lodash._getnative'); /* Native method references for those with the same name as other `lodash` methods. */ var nativeIsFinite = global.isFinite, - nativeNumIsFinite = isNative(nativeNumIsFinite = Number.isFinite) && nativeNumIsFinite; + nativeNumIsFinite = getNative(Number, 'isFinite'); /** * Checks if `value` is a finite primitive number. diff --git a/lodash.isfinite/package.json b/lodash.isfinite/package.json index 4dc85d6f4..ea2be8aab 100644 --- a/lodash.isfinite/package.json +++ b/lodash.isfinite/package.json @@ -1,6 +1,6 @@ { "name": "lodash.isfinite", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.isFinite` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,6 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash.isnative": "^3.0.0" + "lodash._getnative": "^3.0.0" } } diff --git a/lodash.ismatch/README.md b/lodash.ismatch/README.md index 973cb0b08..10a6e3216 100644 --- a/lodash.ismatch/README.md +++ b/lodash.ismatch/README.md @@ -1,4 +1,4 @@ -# lodash.ismatch v3.0.0 +# lodash.ismatch v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.isMatch` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var isMatch = require('lodash.ismatch'); ``` -See the [documentation](https://lodash.com/docs#isMatch) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.ismatch) for more details. +See the [documentation](https://lodash.com/docs#isMatch) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.ismatch) for more details. diff --git a/lodash.ismatch/index.js b/lodash.ismatch/index.js index c82f9a9c8..a2abefb10 100644 --- a/lodash.ismatch/index.js +++ b/lodash.ismatch/index.js @@ -1,12 +1,12 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.7.0 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseIsEqual = require('lodash._baseisequal'), +var baseIsMatch = require('lodash._baseismatch'), bindCallback = require('lodash._bindcallback'), keys = require('lodash.keys'); @@ -16,55 +16,6 @@ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; -/** - * The base implementation of `_.isMatch` without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Object} source The object to inspect. - * @param {Array} props The source property names to match. - * @param {Array} values The source values to match. - * @param {Array} strictCompareFlags Strict comparison flags for source values. - * @param {Function} [customizer] The function to customize comparing objects. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ -function baseIsMatch(object, props, values, strictCompareFlags, customizer) { - var length = props.length; - if (object == null) { - return !length; - } - var index = -1, - noCustomizer = !customizer; - - while (++index < length) { - if ((noCustomizer && strictCompareFlags[index]) - ? values[index] !== object[props[index]] - : !hasOwnProperty.call(object, props[index]) - ) { - return false; - } - } - index = -1; - while (++index < length) { - var key = props[index]; - if (noCustomizer && strictCompareFlags[index]) { - var result = hasOwnProperty.call(object, key); - } else { - var objValue = object[key], - srcValue = values[index]; - - result = customizer ? customizer(objValue, srcValue, key) : undefined; - if (typeof result == 'undefined') { - result = baseIsEqual(srcValue, objValue, customizer, true); - } - } - if (!result) { - return false; - } - } - return true; -} - /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * @@ -121,7 +72,7 @@ function isObject(value) { * @static * @memberOf _ * @category Lang - * @param {Object} source The object to inspect. + * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Function} [customizer] The function to customize comparing values. * @param {*} [thisArg] The `this` binding of `customizer`. diff --git a/lodash.ismatch/package.json b/lodash.ismatch/package.json index c9520ab7f..946d2397f 100644 --- a/lodash.ismatch/package.json +++ b/lodash.ismatch/package.json @@ -1,6 +1,6 @@ { "name": "lodash.ismatch", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.isMatch` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,7 +17,7 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._baseisequal": "^3.0.0", + "lodash._baseismatch": "^3.0.0", "lodash._bindcallback": "^3.0.0", "lodash.keys": "^3.0.0" } diff --git a/lodash.isplainobject/README.md b/lodash.isplainobject/README.md index fd2512683..44b9b7db6 100644 --- a/lodash.isplainobject/README.md +++ b/lodash.isplainobject/README.md @@ -1,4 +1,4 @@ -# lodash.isplainobject v3.0.2 +# lodash.isplainobject v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.isPlainObject` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var isPlainObject = require('lodash.isplainobject'); ``` -See the [documentation](https://lodash.com/docs#isPlainObject) or [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash.isplainobject) for more details. +See the [documentation](https://lodash.com/docs#isPlainObject) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.isplainobject) for more details. diff --git a/lodash.isplainobject/index.js b/lodash.isplainobject/index.js index b39aea454..8bab99faf 100644 --- a/lodash.isplainobject/index.js +++ b/lodash.isplainobject/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.2 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.3 @@ -7,7 +7,7 @@ * Available under MIT license */ var baseFor = require('lodash._basefor'), - isNative = require('lodash.isnative'), + getNative = require('lodash._getnative'), keysIn = require('lodash.keysin'); /** `Object#toString` result references. */ @@ -37,7 +37,7 @@ var hasOwnProperty = objectProto.hasOwnProperty; var objToString = objectProto.toString; /** Native method references. */ -var getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf; +var getPrototypeOf = getNative(Object, 'getPrototypeOf'); /** * The base implementation of `_.forIn` without support for callback @@ -117,8 +117,8 @@ var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { if (!(value && objToString.call(value) == objectTag)) { return false; } - var valueOf = value.valueOf, - objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); + var valueOf = getNative(value, 'valueOf'), + objProto = valueOf && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); return objProto ? (value == objProto || getPrototypeOf(value) == objProto) diff --git a/lodash.isplainobject/package.json b/lodash.isplainobject/package.json index 260c054de..bab225ba1 100644 --- a/lodash.isplainobject/package.json +++ b/lodash.isplainobject/package.json @@ -1,6 +1,6 @@ { "name": "lodash.isplainobject", - "version": "3.0.2", + "version": "3.1.0", "description": "The modern build of lodash’s `_.isPlainObject` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,7 +18,7 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._basefor": "^3.0.0", - "lodash.isnative": "^3.0.0", + "lodash._getnative": "^3.0.0", "lodash.keysin": "^3.0.0" } } diff --git a/lodash.kebabcase/LICENSE b/lodash.kebabcase/LICENSE new file mode 100644 index 000000000..b054ca5a3 --- /dev/null +++ b/lodash.kebabcase/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lodash.kebabcase/README.md b/lodash.kebabcase/README.md index 6c0b019ee..bfbe55af7 100644 --- a/lodash.kebabcase/README.md +++ b/lodash.kebabcase/README.md @@ -1,20 +1,18 @@ -# lodash.kebabcase v3.0.1 +# lodash.kebabcase v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.kebabCase` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.kebabCase` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.kebabcase ``` -In Node.js/io.js: - +In Node.js: ```js var kebabCase = require('lodash.kebabcase'); ``` -See the [documentation](https://lodash.com/docs#kebabCase) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.kebabcase) for more details. +See the [documentation](https://lodash.com/docs#kebabCase) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.kebabcase) for more details. diff --git a/lodash.kebabcase/index.js b/lodash.kebabcase/index.js index b34b4820d..5ecafc2c7 100644 --- a/lodash.kebabcase/index.js +++ b/lodash.kebabcase/index.js @@ -1,12 +1,50 @@ /** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var createCompounder = require('lodash._createcompounder'); +var deburr = require('lodash.deburr'), + words = require('lodash.words'); + +/** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initFromArray] Specify using the first element of `array` as the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduce(array, iteratee, accumulator, initFromArray) { + var index = -1, + length = array.length; + + if (initFromArray && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} + +/** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ +function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string)), callback, ''); + }; +} /** * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). diff --git a/lodash.kebabcase/package.json b/lodash.kebabcase/package.json index dba9c4f38..7567e3537 100644 --- a/lodash.kebabcase/package.json +++ b/lodash.kebabcase/package.json @@ -1,22 +1,21 @@ { "name": "lodash.kebabcase", - "version": "3.0.1", - "description": "The modern build of lodash’s `_.kebabCase` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.kebabCase` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, kebabcase", "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", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._createcompounder": "^3.0.0" + "lodash.deburr": "^3.0.0", + "lodash.words": "^3.0.0" } } diff --git a/lodash.keys/README.md b/lodash.keys/README.md index 0f550f6d5..3dec3fb20 100644 --- a/lodash.keys/README.md +++ b/lodash.keys/README.md @@ -1,4 +1,4 @@ -# lodash.keys v3.0.7 +# lodash.keys v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.keys` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var keys = require('lodash.keys'); ``` -See the [documentation](https://lodash.com/docs#keys) or [package source](https://github.com/lodash/lodash/blob/3.0.7-npm-packages/lodash.keys) for more details. +See the [documentation](https://lodash.com/docs#keys) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.keys) for more details. diff --git a/lodash.keys/index.js b/lodash.keys/index.js index 7ddf41921..736827857 100644 --- a/lodash.keys/index.js +++ b/lodash.keys/index.js @@ -1,14 +1,14 @@ /** - * lodash 3.0.7 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var isArguments = require('lodash.isarguments'), - isArray = require('lodash.isarray'), - isNative = require('lodash.isnative'); +var getNative = require('lodash._getnative'), + isArguments = require('lodash.isarguments'), + isArray = require('lodash.isarray'); /** Used for native method references. */ var objectProto = Object.prototype; @@ -16,54 +16,14 @@ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; -/** Native method references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; - /* Native method references for those with the same name as other `lodash` methods. */ -var nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys; +var nativeKeys = getNative(Object, 'keys'); /** * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) * of an array-like value. */ -var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; - -/** - * An object environment feature flags. - * - * @static - * @memberOf _ - * @type Object - */ -var support = {}; - -(function(x) { - var Ctor = function() { this.x = x; }, - args = arguments, - object = { '0': x, 'length': x }, - props = []; - - Ctor.prototype = { 'valueOf': x, 'y': x }; - for (var key in new Ctor) { props.push(key); } - - /** - * Detect if `arguments` object indexes are non-enumerable. - * - * In Firefox < 4, IE < 9, PhantomJS, and Safari < 5.1 `arguments` object - * indexes are non-enumerable. Chrome < 25 and Node.js < 0.11.0 treat - * `arguments` object indexes as non-enumerable and fail `hasOwnProperty` - * checks for indexes that exceed the number of function parameters and - * whose associated argument values are `0`. - * - * @memberOf _.support - * @type boolean - */ - try { - support.nonEnumArgs = !propertyIsEnumerable.call(args, 1); - } catch(e) { - support.nonEnumArgs = true; - } -}(1, 0)); +var MAX_SAFE_INTEGER = 9007199254740991; /** * The base implementation of `_.property` without support for deep paths. @@ -110,7 +70,7 @@ function isArrayLike(value) { * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { - value = +value; + value = typeof value == 'number' ? value : parseFloat(value); length = length == null ? MAX_SAFE_INTEGER : length; return value > -1 && value % 1 == 0 && value < length; } @@ -141,8 +101,8 @@ function shimKeys(object) { propsLength = props.length, length = propsLength && object.length; - var allowIndexes = length && isLength(length) && - (isArray(object) || (support.nonEnumArgs && isArguments(object))); + var allowIndexes = !!length && isLength(length) && + (isArray(object) || isArguments(object)); var index = -1, result = []; @@ -180,7 +140,7 @@ function isObject(value) { // Avoid a V8 JIT bug in Chrome 19-20. // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; - return type == 'function' || (!!value && type == 'object'); + return !!value && (type == 'object' || type == 'function'); } /** @@ -211,7 +171,7 @@ function isObject(value) { * // => ['0', '1'] */ var keys = !nativeKeys ? shimKeys : function(object) { - var Ctor = object != null && object.constructor; + var Ctor = object == null ? null : object.constructor; if ((typeof Ctor == 'function' && Ctor.prototype === object) || (typeof object != 'function' && isArrayLike(object))) { return shimKeys(object); @@ -250,7 +210,7 @@ function keysIn(object) { } var length = object.length; length = (length && isLength(length) && - (isArray(object) || (support.nonEnumArgs && isArguments(object))) && length) || 0; + (isArray(object) || isArguments(object)) && length) || 0; var Ctor = object.constructor, index = -1, diff --git a/lodash.keys/package.json b/lodash.keys/package.json index 94843ce60..9a044b6df 100644 --- a/lodash.keys/package.json +++ b/lodash.keys/package.json @@ -1,6 +1,6 @@ { "name": "lodash.keys", - "version": "3.0.7", + "version": "3.1.0", "description": "The modern build of lodash’s `_.keys` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,8 +17,8 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { + "lodash._getnative": "^3.0.0", "lodash.isarguments": "^3.0.0", - "lodash.isarray": "^3.0.0", - "lodash.isnative": "^3.0.0" + "lodash.isarray": "^3.0.0" } } diff --git a/lodash.map/LICENSE.txt b/lodash.map/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.map/LICENSE.txt +++ b/lodash.map/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.map/README.md b/lodash.map/README.md index 70cf0a851..19d3b1dd8 100644 --- a/lodash.map/README.md +++ b/lodash.map/README.md @@ -1,4 +1,4 @@ -# lodash.map v3.0.0 +# lodash.map v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.map` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var map = require('lodash.map'); ``` -See the [documentation](https://lodash.com/docs#map) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.map) for more details. +See the [documentation](https://lodash.com/docs#map) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.map) for more details. diff --git a/lodash.map/index.js b/lodash.map/index.js index fcc1e8d75..9efcb9b64 100644 --- a/lodash.map/index.js +++ b/lodash.map/index.js @@ -1,15 +1,16 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var arrayMap = require('lodash._arraymap'), baseCallback = require('lodash._basecallback'), baseEach = require('lodash._baseeach'), - isArray = require('lodash.isarray'); + isArray = require('lodash.isarray'), + keys = require('lodash.keys'); /** * The base implementation of `_.map` without support for callback shorthands diff --git a/lodash.map/package.json b/lodash.map/package.json index 048974f41..e257bc9c0 100644 --- a/lodash.map/package.json +++ b/lodash.map/package.json @@ -1,6 +1,6 @@ { "name": "lodash.map", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.map` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -20,6 +20,7 @@ "lodash._arraymap": "^3.0.0", "lodash._basecallback": "^3.0.0", "lodash._baseeach": "^3.0.0", - "lodash.isarray": "^3.0.0" + "lodash.isarray": "^3.0.0", + "lodash.keys": "^3.0.0" } } diff --git a/lodash.matches/README.md b/lodash.matches/README.md index 677577000..e6bf420b1 100644 --- a/lodash.matches/README.md +++ b/lodash.matches/README.md @@ -1,4 +1,4 @@ -# lodash.matches v3.0.0 +# lodash.matches v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.matches` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var matches = require('lodash.matches'); ``` -See the [documentation](https://lodash.com/docs#matches) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.matches) for more details. +See the [documentation](https://lodash.com/docs#matches) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.matches) for more details. diff --git a/lodash.matches/index.js b/lodash.matches/index.js index 33e7da23b..48d9f40fd 100644 --- a/lodash.matches/index.js +++ b/lodash.matches/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.7.0 @@ -7,149 +7,18 @@ * Available under MIT license */ var baseClone = require('lodash._baseclone'), - baseIsEqual = require('lodash._baseisequal'), - keys = require('lodash.keys'); - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + baseMatches = require('lodash._basematches'); /** - * The base implementation of `_.isMatch` without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Object} source The object to inspect. - * @param {Array} props The source property names to match. - * @param {Array} values The source values to match. - * @param {Array} strictCompareFlags Strict comparison flags for source values. - * @param {Function} [customizer] The function to customize comparing objects. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ -function baseIsMatch(object, props, values, strictCompareFlags, customizer) { - var length = props.length; - if (object == null) { - return !length; - } - var index = -1, - noCustomizer = !customizer; - - while (++index < length) { - if ((noCustomizer && strictCompareFlags[index]) - ? values[index] !== object[props[index]] - : !hasOwnProperty.call(object, props[index]) - ) { - return false; - } - } - index = -1; - while (++index < length) { - var key = props[index]; - if (noCustomizer && strictCompareFlags[index]) { - var result = hasOwnProperty.call(object, key); - } else { - var objValue = object[key], - srcValue = values[index]; - - result = customizer ? customizer(objValue, srcValue, key) : undefined; - if (typeof result == 'undefined') { - result = baseIsEqual(srcValue, objValue, customizer, true); - } - } - if (!result) { - return false; - } - } - return true; -} - -/** - * The base implementation of `_.matches` which supports specifying whether - * `source` should be cloned. - * - * @private - * @param {Object} source The object of property values to match. - * @param {boolean} [isCloned] Specify cloning the source object. - * @returns {Function} Returns the new function. - */ -function baseMatches(source, isCloned) { - var props = keys(source), - length = props.length; - - if (length == 1) { - var key = props[0], - value = source[key]; - - if (isStrictComparable(value)) { - return function(object) { - return object != null && value === object[key] && hasOwnProperty.call(object, key); - }; - } - } - if (isCloned) { - source = baseClone(source, true); - } - var values = Array(length), - strictCompareFlags = Array(length); - - while (length--) { - value = source[props[length]]; - values[length] = value; - strictCompareFlags[length] = isStrictComparable(value); - } - return function(object) { - return baseIsMatch(object, props, values, strictCompareFlags); - }; -} - -/** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ -function isStrictComparable(value) { - return value === value && (value === 0 ? ((1 / value) > 0) : !isObject(value)); -} - -/** - * Checks if `value` is the language type of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * **Note:** See the [ES5 spec](https://es5.github.io/#x8) for more details. - * - * @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(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return type == 'function' || (value && type == 'object') || false; -} - -/** - * Creates a function which performs a deep comparison between a given object + * Creates a function that performs a deep comparison between a given object * and `source`, returning `true` if the given object has equivalent property * values, else `false`. * + * **Note:** This method supports comparing arrays, booleans, `Date` objects, + * numbers, `Object` objects, regexes, and strings. Objects are compared by + * their own, not inherited, enumerable properties. For comparing a single + * own or inherited property value see `_.matchesProperty`. + * * @static * @memberOf _ * @category Utility @@ -158,20 +27,15 @@ function isObject(value) { * @example * * var users = [ - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'barney', 'age': 36 } + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } * ]; * - * var matchesAge = _.matches({ 'age': 36 }); - * - * _.filter(users, matchesAge); - * // => [{ 'user': 'barney', 'age': 36 }] - * - * _.find(users, matchesAge); - * // => { 'user': 'barney', 'age': 36 } + * _.filter(users, _.matches({ 'age': 40, 'active': false })); + * // => [{ 'user': 'fred', 'age': 40, 'active': false }] */ function matches(source) { - return baseMatches(source, true); + return baseMatches(baseClone(source, true)); } module.exports = matches; diff --git a/lodash.matches/package.json b/lodash.matches/package.json index 80276590c..afb8487e6 100644 --- a/lodash.matches/package.json +++ b/lodash.matches/package.json @@ -1,6 +1,6 @@ { "name": "lodash.matches", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.matches` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,7 +18,6 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._baseclone": "^3.0.0", - "lodash._baseisequal": "^3.0.0", - "lodash.keys": "^3.0.0" + "lodash._basematches": "^3.0.0" } } diff --git a/lodash.max/LICENSE.txt b/lodash.max/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.max/LICENSE.txt +++ b/lodash.max/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.max/README.md b/lodash.max/README.md index 79827ad07..a54fcb23a 100644 --- a/lodash.max/README.md +++ b/lodash.max/README.md @@ -1,4 +1,4 @@ -# lodash.max v3.0.0 +# lodash.max v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.max` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var max = require('lodash.max'); ``` -See the [documentation](https://lodash.com/docs#max) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.max) for more details. +See the [documentation](https://lodash.com/docs#max) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.max) for more details. diff --git a/lodash.max/index.js b/lodash.max/index.js index 164bb4db8..73f87f3c8 100644 --- a/lodash.max/index.js +++ b/lodash.max/index.js @@ -1,29 +1,106 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var arrayMax = require('lodash._arraymax'), - createExtremum = require('lodash._createextremum'); + baseCallback = require('lodash._basecallback'), + baseEach = require('lodash._baseeach'), + isIterateeCall = require('lodash._isiterateecall'), + toIterable = require('lodash._toiterable'), + isArray = require('lodash.isarray'), + isString = require('lodash.isstring'); + +/** + * Used by `_.max` and `_.min` as the default callback for string values. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the code unit of the first character of the string. + */ +function charAtCallback(string) { + return string.charCodeAt(0); +} + +/** Used as references for `-Infinity` and `Infinity`. */ +var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY, + POSITIVE_INFINITY = Number.POSITIVE_INFINITY; + +/** + * Creates a `_.max` or `_.min` function. + * + * @private + * @param {Function} arrayFunc The function to get the extremum value from an array. + * @param {boolean} [isMin] Specify returning the minimum, instead of the maximum, + * extremum value. + * @returns {Function} Returns the new extremum function. + */ +function createExtremum(arrayFunc, isMin) { + return function(collection, iteratee, thisArg) { + if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { + iteratee = null; + } + var noIteratee = iteratee == null; + + iteratee = noIteratee ? iteratee : baseCallback(iteratee, thisArg, 3); + if (noIteratee) { + var isArr = isArray(collection); + if (!isArr && isString(collection)) { + iteratee = charAtCallback; + } else { + return arrayFunc(isArr ? collection : toIterable(collection)); + } + } + return extremumBy(collection, iteratee, isMin); + }; +} + +/** + * Gets the extremum value of `collection` invoking `iteratee` for each value + * in `collection` to generate the criterion by which the value is ranked. + * The `iteratee` is invoked with three arguments: (value, index, collection). + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {boolean} [isMin] Specify returning the minimum, instead of the + * maximum, extremum value. + * @returns {*} Returns the extremum value. + */ +function extremumBy(collection, iteratee, isMin) { + var exValue = isMin ? POSITIVE_INFINITY : NEGATIVE_INFINITY, + computed = exValue, + result = computed; + + baseEach(collection, function(value, index, collection) { + var current = iteratee(value, index, collection); + if ((isMin ? (current < computed) : (current > computed)) || + (current === exValue && current === result)) { + computed = current; + result = value; + } + }); + return result; +} /** * Gets the maximum value of `collection`. If `collection` is empty or falsey * `-Infinity` is returned. If an iteratee function is provided it is invoked * for each value in `collection` to generate the criterion by which the value * is ranked. The `iteratee` is bound to `thisArg` and invoked with three - * arguments; (value, index, collection). + * arguments: (value, index, collection). * - * If a property name is provided for `predicate` the created `_.property` + * If a property name is provided for `iteratee` the created `_.property` * style callback returns the property value of the given element. * * If a value is also provided for `thisArg` the created `_.matchesProperty` * style callback returns `true` for elements that have a matching property * value, else `false`. * - * If an object is provided for `predicate` the created `_.matches` style + * If an object is provided for `iteratee` the created `_.matches` style * callback returns `true` for elements that have the properties of the given * object, else `false`. * @@ -50,11 +127,11 @@ var arrayMax = require('lodash._arraymax'), * _.max(users, function(chr) { * return chr.age; * }); - * // => { 'user': 'fred', 'age': 40 }; + * // => { 'user': 'fred', 'age': 40 } * * // using the `_.property` callback shorthand * _.max(users, 'age'); - * // => { 'user': 'fred', 'age': 40 }; + * // => { 'user': 'fred', 'age': 40 } */ var max = createExtremum(arrayMax); diff --git a/lodash.max/package.json b/lodash.max/package.json index 9a184ccc7..2731151f6 100644 --- a/lodash.max/package.json +++ b/lodash.max/package.json @@ -1,6 +1,6 @@ { "name": "lodash.max", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.max` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,6 +18,11 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._arraymax": "^3.0.0", - "lodash._createextremum": "^3.0.0" + "lodash._basecallback": "^3.0.0", + "lodash._baseeach": "^3.0.0", + "lodash._isiterateecall": "^3.0.0", + "lodash._toiterable": "^3.0.0", + "lodash.isarray": "^3.0.0", + "lodash.isstring": "^3.0.0" } } diff --git a/lodash.memoize/LICENSE b/lodash.memoize/LICENSE new file mode 100644 index 000000000..b054ca5a3 --- /dev/null +++ b/lodash.memoize/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lodash.memoize/README.md b/lodash.memoize/README.md index a417e274a..a67b66a29 100644 --- a/lodash.memoize/README.md +++ b/lodash.memoize/README.md @@ -1,20 +1,18 @@ -# lodash.memoize v3.0.4 +# lodash.memoize v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.memoize` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.memoize` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.memoize ``` -In Node.js/io.js: - +In Node.js: ```js var memoize = require('lodash.memoize'); ``` -See the [documentation](https://lodash.com/docs#memoize) or [package source](https://github.com/lodash/lodash/blob/3.0.4-npm-packages/lodash.memoize) for more details. +See the [documentation](https://lodash.com/docs#memoize) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.memoize) for more details. diff --git a/lodash.memoize/index.js b/lodash.memoize/index.js index aef5f16e9..c7f9f006a 100644 --- a/lodash.memoize/index.js +++ b/lodash.memoize/index.js @@ -1,94 +1,27 @@ -/** Used as the `TypeError` message for "Functions" methods. */ +/** + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var MapCache = require('lodash._mapcache'); /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates a cache object to store key/value pairs. - * - * @private - * @static - * @name Cache - * @memberOf _.memoize - */ -function MapCache() { - this.__data__ = {}; -} - -/** - * Removes `key` and its value from the cache. - * - * @private - * @name delete - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`. - */ -function mapDelete(key) { - return this.has(key) && delete this.__data__[key]; -} - -/** - * Gets the cached value for `key`. - * - * @private - * @name get - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to get. - * @returns {*} Returns the cached value. - */ -function mapGet(key) { - return key == '__proto__' ? undefined : this.__data__[key]; -} - -/** - * Checks if a cached value for `key` exists. - * - * @private - * @name has - * @memberOf _.memoize.Cache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapHas(key) { - return key != '__proto__' && hasOwnProperty.call(this.__data__, key); -} - -/** - * Sets `value` to `key` of the cache. - * - * @private - * @name set - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to cache. - * @param {*} value The value to cache. - * @returns {Object} Returns the cache object. - */ -function mapSet(key, value) { - if (key != '__proto__') { - this.__data__[key] = value; - } - return this; -} - /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is coerced to a string and used as the - * cache key. The `func` is invoked with the `this` binding of the memoized - * function. + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) - * method interface of `get`, `has`, and `set`. + * method interface of `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ @@ -98,35 +31,27 @@ function mapSet(key, value) { * @returns {Function} Returns the new memoizing function. * @example * - * var upperCase = _.memoize(function(string) { - * return string.toUpperCase(); - * }); + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; * - * upperCase('fred'); - * // => 'FRED' + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] * * // modifying the result cache - * upperCase.cache.set('fred', 'BARNEY'); - * upperCase('fred'); - * // => 'BARNEY' + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] * * // replacing `_.memoize.Cache` - * var object = { 'user': 'fred' }; - * var other = { 'user': 'barney' }; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'fred' } - * * _.memoize.Cache = WeakMap; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'barney' } */ function memoize(func, resolver) { if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { @@ -148,12 +73,6 @@ function memoize(func, resolver) { return memoized; } -// Add functions to the `Map` cache. -MapCache.prototype['delete'] = mapDelete; -MapCache.prototype.get = mapGet; -MapCache.prototype.has = mapHas; -MapCache.prototype.set = mapSet; - // Assign cache to `_.memoize`. memoize.Cache = MapCache; diff --git a/lodash.memoize/package.json b/lodash.memoize/package.json index 591b2bdfb..32d91c3ce 100644 --- a/lodash.memoize/package.json +++ b/lodash.memoize/package.json @@ -1,19 +1,20 @@ { "name": "lodash.memoize", - "version": "3.0.4", - "description": "The modern build of lodash’s `_.memoize` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.memoize` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, memoize", "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", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, + "dependencies": { + "lodash._mapcache": "^3.0.0" + } } diff --git a/lodash.merge/README.md b/lodash.merge/README.md index 80167daba..bccd4d473 100644 --- a/lodash.merge/README.md +++ b/lodash.merge/README.md @@ -1,4 +1,4 @@ -# lodash.merge v3.0.3 +# lodash.merge v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.merge` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var merge = require('lodash.merge'); ``` -See the [documentation](https://lodash.com/docs#merge) or [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash.merge) for more details. +See the [documentation](https://lodash.com/docs#merge) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.merge) for more details. diff --git a/lodash.merge/index.js b/lodash.merge/index.js index dfa16254a..8e8f36578 100644 --- a/lodash.merge/index.js +++ b/lodash.merge/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.3 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.2 @@ -12,9 +12,11 @@ var arrayCopy = require('lodash._arraycopy'), createAssigner = require('lodash._createassigner'), isArguments = require('lodash.isarguments'), isArray = require('lodash.isarray'), + isNative = require('lodash.isnative'), isPlainObject = require('lodash.isplainobject'), isTypedArray = require('lodash.istypedarray'), keys = require('lodash.keys'), + keysIn = require('lodash.keysin'), toPlainObject = require('lodash.toplainobject'); /** @@ -25,13 +27,12 @@ var arrayCopy = require('lodash._arraycopy'), * @returns {boolean} Returns `true` if `value` is object-like, else `false`. */ function isObjectLike(value) { - return (value && typeof value == 'object') || false; + return !!value && typeof value == 'object'; } /** - * Used as the maximum length of an array-like value. - * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) - * for more details. + * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) + * of an array-like value. */ var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; @@ -120,7 +121,7 @@ function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stack if (isLength(srcValue.length) && (isArray(srcValue) || isTypedArray(srcValue))) { result = isArray(value) ? value - : (value ? arrayCopy(value) : []); + : ((value && value.length) ? arrayCopy(value) : []); } else if (isPlainObject(srcValue) || isArguments(srcValue)) { result = isArguments(value) @@ -147,9 +148,7 @@ function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stack /** * Checks if `value` is a valid array-like length. * - * **Note:** This function is based on ES `ToLength`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) - * for more details. + * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). * * @private * @param {*} value The value to check. @@ -160,11 +159,9 @@ function isLength(value) { } /** - * Checks if `value` is the language type of `Object`. + * 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('')`) * - * **Note:** See the [ES5 spec](https://es5.github.io/#x8) for more details. - * * @static * @memberOf _ * @category Lang @@ -185,7 +182,7 @@ function isObject(value) { // Avoid a V8 JIT bug in Chrome 19-20. // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. var type = typeof value; - return type == 'function' || (value && type == 'object') || false; + return type == 'function' || (!!value && type == 'object'); } /** @@ -195,7 +192,7 @@ function isObject(value) { * provided it is invoked to produce the merged values of the destination and * source properties. If `customizer` returns `undefined` merging is handled * by the method instead. The `customizer` is bound to `thisArg` and invoked - * with five arguments; (objectValue, sourceValue, key, object, source). + * with five arguments: (objectValue, sourceValue, key, object, source). * * @static * @memberOf _ diff --git a/lodash.merge/package.json b/lodash.merge/package.json index f2ebee957..44b1c1dc4 100644 --- a/lodash.merge/package.json +++ b/lodash.merge/package.json @@ -1,6 +1,6 @@ { "name": "lodash.merge", - "version": "3.0.3", + "version": "3.1.0", "description": "The modern build of lodash’s `_.merge` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -23,9 +23,11 @@ "lodash._createassigner": "^3.0.0", "lodash.isarguments": "^3.0.0", "lodash.isarray": "^3.0.0", + "lodash.isnative": "^3.0.0", "lodash.isplainobject": "^3.0.0", "lodash.istypedarray": "^3.0.0", "lodash.keys": "^3.0.0", + "lodash.keysin": "^3.0.0", "lodash.toplainobject": "^3.0.0" } } diff --git a/lodash.min/LICENSE.txt b/lodash.min/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.min/LICENSE.txt +++ b/lodash.min/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.min/README.md b/lodash.min/README.md index 4c8c36ad8..7a5a78eb6 100644 --- a/lodash.min/README.md +++ b/lodash.min/README.md @@ -1,4 +1,4 @@ -# lodash.min v3.0.0 +# lodash.min v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.min` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var min = require('lodash.min'); ``` -See the [documentation](https://lodash.com/docs#min) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.min) for more details. +See the [documentation](https://lodash.com/docs#min) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.min) for more details. diff --git a/lodash.min/index.js b/lodash.min/index.js index 05aec461b..444dcb336 100644 --- a/lodash.min/index.js +++ b/lodash.min/index.js @@ -1,29 +1,106 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var arrayMin = require('lodash._arraymin'), - createExtremum = require('lodash._createextremum'); + baseCallback = require('lodash._basecallback'), + baseEach = require('lodash._baseeach'), + isIterateeCall = require('lodash._isiterateecall'), + toIterable = require('lodash._toiterable'), + isArray = require('lodash.isarray'), + isString = require('lodash.isstring'); + +/** + * Used by `_.max` and `_.min` as the default callback for string values. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the code unit of the first character of the string. + */ +function charAtCallback(string) { + return string.charCodeAt(0); +} + +/** Used as references for `-Infinity` and `Infinity`. */ +var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY, + POSITIVE_INFINITY = Number.POSITIVE_INFINITY; + +/** + * Creates a `_.max` or `_.min` function. + * + * @private + * @param {Function} arrayFunc The function to get the extremum value from an array. + * @param {boolean} [isMin] Specify returning the minimum, instead of the maximum, + * extremum value. + * @returns {Function} Returns the new extremum function. + */ +function createExtremum(arrayFunc, isMin) { + return function(collection, iteratee, thisArg) { + if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { + iteratee = null; + } + var noIteratee = iteratee == null; + + iteratee = noIteratee ? iteratee : baseCallback(iteratee, thisArg, 3); + if (noIteratee) { + var isArr = isArray(collection); + if (!isArr && isString(collection)) { + iteratee = charAtCallback; + } else { + return arrayFunc(isArr ? collection : toIterable(collection)); + } + } + return extremumBy(collection, iteratee, isMin); + }; +} + +/** + * Gets the extremum value of `collection` invoking `iteratee` for each value + * in `collection` to generate the criterion by which the value is ranked. + * The `iteratee` is invoked with three arguments: (value, index, collection). + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {boolean} [isMin] Specify returning the minimum, instead of the + * maximum, extremum value. + * @returns {*} Returns the extremum value. + */ +function extremumBy(collection, iteratee, isMin) { + var exValue = isMin ? POSITIVE_INFINITY : NEGATIVE_INFINITY, + computed = exValue, + result = computed; + + baseEach(collection, function(value, index, collection) { + var current = iteratee(value, index, collection); + if ((isMin ? (current < computed) : (current > computed)) || + (current === exValue && current === result)) { + computed = current; + result = value; + } + }); + return result; +} /** * Gets the minimum value of `collection`. If `collection` is empty or falsey * `Infinity` is returned. If an iteratee function is provided it is invoked * for each value in `collection` to generate the criterion by which the value * is ranked. The `iteratee` is bound to `thisArg` and invoked with three - * arguments; (value, index, collection). + * arguments: (value, index, collection). * - * If a property name is provided for `predicate` the created `_.property` + * If a property name is provided for `iteratee` the created `_.property` * style callback returns the property value of the given element. * * If a value is also provided for `thisArg` the created `_.matchesProperty` * style callback returns `true` for elements that have a matching property * value, else `false`. * - * If an object is provided for `predicate` the created `_.matches` style + * If an object is provided for `iteratee` the created `_.matches` style * callback returns `true` for elements that have the properties of the given * object, else `false`. * @@ -50,11 +127,11 @@ var arrayMin = require('lodash._arraymin'), * _.min(users, function(chr) { * return chr.age; * }); - * // => { 'user': 'barney', 'age': 36 }; + * // => { 'user': 'barney', 'age': 36 } * * // using the `_.property` callback shorthand * _.min(users, 'age'); - * // => { 'user': 'barney', 'age': 36 }; + * // => { 'user': 'barney', 'age': 36 } */ var min = createExtremum(arrayMin, true); diff --git a/lodash.min/package.json b/lodash.min/package.json index 3a9973f34..9fc48ce0f 100644 --- a/lodash.min/package.json +++ b/lodash.min/package.json @@ -1,6 +1,6 @@ { "name": "lodash.min", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.min` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,6 +18,11 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._arraymin": "^3.0.0", - "lodash._createextremum": "^3.0.0" + "lodash._basecallback": "^3.0.0", + "lodash._baseeach": "^3.0.0", + "lodash._isiterateecall": "^3.0.0", + "lodash._toiterable": "^3.0.0", + "lodash.isarray": "^3.0.0", + "lodash.isstring": "^3.0.0" } } diff --git a/lodash.now/LICENSE.txt b/lodash.now/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.now/LICENSE.txt +++ b/lodash.now/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.now/README.md b/lodash.now/README.md index 4002adaf9..691ccd9b3 100644 --- a/lodash.now/README.md +++ b/lodash.now/README.md @@ -1,4 +1,4 @@ -# lodash.now v3.0.0 +# lodash.now v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.now` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var now = require('lodash.now'); ``` -See the [documentation](https://lodash.com/docs#now) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.now) for more details. +See the [documentation](https://lodash.com/docs#now) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.now) for more details. diff --git a/lodash.now/index.js b/lodash.now/index.js index 6ef273723..d07b60c5f 100644 --- a/lodash.now/index.js +++ b/lodash.now/index.js @@ -1,15 +1,15 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var isNative = require('lodash.isnative'); +var getNative = require('lodash._getnative'); /* Native method references for those with the same name as other `lodash` methods. */ -var nativeNow = isNative(nativeNow = Date.now) && nativeNow; +var nativeNow = getNative(Date, 'now'); /** * Gets the number of milliseconds that have elapsed since the Unix epoch diff --git a/lodash.now/package.json b/lodash.now/package.json index 2618b4b9b..40b8bfe45 100644 --- a/lodash.now/package.json +++ b/lodash.now/package.json @@ -1,6 +1,6 @@ { "name": "lodash.now", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.now` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,6 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash.isnative": "^3.0.0" + "lodash._getnative": "^3.0.0" } } diff --git a/lodash.omit/LICENSE.txt b/lodash.omit/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.omit/LICENSE.txt +++ b/lodash.omit/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.omit/README.md b/lodash.omit/README.md index 2a02d06aa..49990faf9 100644 --- a/lodash.omit/README.md +++ b/lodash.omit/README.md @@ -1,4 +1,4 @@ -# lodash.omit v3.0.0 +# lodash.omit v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.omit` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var omit = require('lodash.omit'); ``` -See the [documentation](https://lodash.com/docs#omit) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.omit) for more details. +See the [documentation](https://lodash.com/docs#omit) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.omit) for more details. diff --git a/lodash.omit/index.js b/lodash.omit/index.js index 66e055f03..4dffbb7ab 100644 --- a/lodash.omit/index.js +++ b/lodash.omit/index.js @@ -1,8 +1,8 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ @@ -12,16 +12,12 @@ var arrayMap = require('lodash._arraymap'), bindCallback = require('lodash._bindcallback'), pickByArray = require('lodash._pickbyarray'), pickByCallback = require('lodash._pickbycallback'), - keysIn = require('lodash.keysin'); + keysIn = require('lodash.keysin'), + restParam = require('lodash.restparam'); /** * The opposite of `_.pick`; this method creates an object composed of the * own and inherited enumerable properties of `object` that are not omitted. - * Property names may be specified as individual arguments or as arrays of - * property names. If `predicate` is provided it is invoked for each property - * of `object` omitting the properties `predicate` returns truthy for. The - * predicate is bound to `thisArg` and invoked with three arguments; - * (value, key, object). * * @static * @memberOf _ @@ -42,18 +38,18 @@ var arrayMap = require('lodash._arraymap'), * _.omit(object, _.isNumber); * // => { 'user': 'fred' } */ -function omit(object, predicate, thisArg) { +var omit = restParam(function(object, props) { if (object == null) { return {}; } - if (typeof predicate != 'function') { - var props = arrayMap(baseFlatten(arguments, false, false, 1), String); + if (typeof props[0] != 'function') { + var props = arrayMap(baseFlatten(props), String); return pickByArray(object, baseDifference(keysIn(object), props)); } - predicate = bindCallback(predicate, thisArg, 3); + var predicate = bindCallback(props[0], props[1], 3); return pickByCallback(object, function(value, key, object) { return !predicate(value, key, object); }); -} +}); module.exports = omit; diff --git a/lodash.omit/package.json b/lodash.omit/package.json index 290244d31..640660844 100644 --- a/lodash.omit/package.json +++ b/lodash.omit/package.json @@ -1,6 +1,6 @@ { "name": "lodash.omit", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.omit` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -23,6 +23,7 @@ "lodash._bindcallback": "^3.0.0", "lodash._pickbyarray": "^3.0.0", "lodash._pickbycallback": "^3.0.0", - "lodash.keysin": "^3.0.0" + "lodash.keysin": "^3.0.0", + "lodash.restparam": "^3.0.0" } } diff --git a/lodash.pad/LICENSE.txt b/lodash.pad/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.pad/LICENSE.txt +++ b/lodash.pad/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.pad/README.md b/lodash.pad/README.md index 57c0bff72..9b4891cd8 100644 --- a/lodash.pad/README.md +++ b/lodash.pad/README.md @@ -1,4 +1,4 @@ -# lodash.pad v3.0.0 +# lodash.pad v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.pad` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var pad = require('lodash.pad'); ``` -See the [documentation](https://lodash.com/docs#pad) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.pad) for more details. +See the [documentation](https://lodash.com/docs#pad) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.pad) for more details. diff --git a/lodash.pad/index.js b/lodash.pad/index.js index f08b0fa63..7a491819f 100644 --- a/lodash.pad/index.js +++ b/lodash.pad/index.js @@ -1,13 +1,13 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseToString = require('lodash._basetostring'), - createPad = require('lodash._createpad'); + createPadding = require('lodash._createpadding'); /** Native method references. */ var ceil = Math.ceil, @@ -17,9 +17,8 @@ var ceil = Math.ceil, var nativeIsFinite = global.isFinite; /** - * Pads `string` on the left and right sides if it is shorter then the given - * padding length. The `chars` string may be truncated if the number of padding - * characters can't be evenly divided by the padding length. + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. * * @static * @memberOf _ @@ -51,7 +50,7 @@ function pad(string, length, chars) { leftLength = floor(mid), rightLength = ceil(mid); - chars = createPad('', rightLength, chars); + chars = createPadding('', rightLength, chars); return chars.slice(0, leftLength) + string + chars; } diff --git a/lodash.pad/package.json b/lodash.pad/package.json index eb02a0829..6af5e7aa0 100644 --- a/lodash.pad/package.json +++ b/lodash.pad/package.json @@ -1,6 +1,6 @@ { "name": "lodash.pad", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.pad` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,6 +18,6 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._basetostring": "^3.0.0", - "lodash._createpad": "^3.0.0" + "lodash._createpadding": "^3.0.0" } } diff --git a/lodash.padleft/LICENSE.txt b/lodash.padleft/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.padleft/LICENSE.txt +++ b/lodash.padleft/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.padleft/README.md b/lodash.padleft/README.md index cd29e458b..bb634f538 100644 --- a/lodash.padleft/README.md +++ b/lodash.padleft/README.md @@ -1,4 +1,4 @@ -# lodash.padleft v3.0.0 +# lodash.padleft v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.padLeft` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var padLeft = require('lodash.padleft'); ``` -See the [documentation](https://lodash.com/docs#padLeft) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.padleft) for more details. +See the [documentation](https://lodash.com/docs#padLeft) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.padleft) for more details. diff --git a/lodash.padleft/index.js b/lodash.padleft/index.js index 975619611..69638d322 100644 --- a/lodash.padleft/index.js +++ b/lodash.padleft/index.js @@ -1,18 +1,31 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseToString = require('lodash._basetostring'), - createPad = require('lodash._createpad'); + createPadding = require('lodash._createpadding'); /** - * Pads `string` on the left side if it is shorter then the given padding - * length. The `chars` string may be truncated if the number of padding - * characters exceeds the padding length. + * Creates a function for `_.padLeft` or `_.padRight`. + * + * @private + * @param {boolean} [fromRight] Specify padding from the right. + * @returns {Function} Returns the new pad function. + */ +function createPadDir(fromRight) { + return function(string, length, chars) { + string = baseToString(string); + return string && ((fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string)); + }; +} + +/** + * Pads `string` on the left side if it is shorter than `length`. Padding + * characters are truncated if they exceed `length`. * * @static * @memberOf _ @@ -32,9 +45,6 @@ var baseToString = require('lodash._basetostring'), * _.padLeft('abc', 3); * // => 'abc' */ -function padLeft(string, length, chars) { - string = baseToString(string); - return string && (createPad(string, length, chars) + string); -} +var padLeft = createPadDir(); module.exports = padLeft; diff --git a/lodash.padleft/package.json b/lodash.padleft/package.json index e9c1d4b2d..f2fbe534b 100644 --- a/lodash.padleft/package.json +++ b/lodash.padleft/package.json @@ -1,6 +1,6 @@ { "name": "lodash.padleft", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.padLeft` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,6 +18,6 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._basetostring": "^3.0.0", - "lodash._createpad": "^3.0.0" + "lodash._createpadding": "^3.0.0" } } diff --git a/lodash.padright/LICENSE.txt b/lodash.padright/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.padright/LICENSE.txt +++ b/lodash.padright/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.padright/README.md b/lodash.padright/README.md index b22b12d3e..e1a742aeb 100644 --- a/lodash.padright/README.md +++ b/lodash.padright/README.md @@ -1,4 +1,4 @@ -# lodash.padright v3.0.0 +# lodash.padright v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.padRight` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var padRight = require('lodash.padright'); ``` -See the [documentation](https://lodash.com/docs#padRight) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.padright) for more details. +See the [documentation](https://lodash.com/docs#padRight) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.padright) for more details. diff --git a/lodash.padright/index.js b/lodash.padright/index.js index dea148f53..252e0a131 100644 --- a/lodash.padright/index.js +++ b/lodash.padright/index.js @@ -1,18 +1,31 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseToString = require('lodash._basetostring'), - createPad = require('lodash._createpad'); + createPadding = require('lodash._createpadding'); /** - * Pads `string` on the right side if it is shorter then the given padding - * length. The `chars` string may be truncated if the number of padding - * characters exceeds the padding length. + * Creates a function for `_.padLeft` or `_.padRight`. + * + * @private + * @param {boolean} [fromRight] Specify padding from the right. + * @returns {Function} Returns the new pad function. + */ +function createPadDir(fromRight) { + return function(string, length, chars) { + string = baseToString(string); + return string && ((fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string)); + }; +} + +/** + * Pads `string` on the right side if it is shorter than `length`. Padding + * characters are truncated if they exceed `length`. * * @static * @memberOf _ @@ -32,9 +45,6 @@ var baseToString = require('lodash._basetostring'), * _.padRight('abc', 3); * // => 'abc' */ -function padRight(string, length, chars) { - string = baseToString(string); - return string && (string + createPad(string, length, chars)); -} +var padRight = createPadDir(true); module.exports = padRight; diff --git a/lodash.padright/package.json b/lodash.padright/package.json index 2f8b1a893..1ba642f2e 100644 --- a/lodash.padright/package.json +++ b/lodash.padright/package.json @@ -1,6 +1,6 @@ { "name": "lodash.padright", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.padRight` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,6 +18,6 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._basetostring": "^3.0.0", - "lodash._createpad": "^3.0.0" + "lodash._createpadding": "^3.0.0" } } diff --git a/lodash.parseint/LICENSE b/lodash.parseint/LICENSE index 9cd87e5dc..b054ca5a3 100644 --- a/lodash.parseint/LICENSE +++ b/lodash.parseint/LICENSE @@ -1,5 +1,5 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.parseint/README.md b/lodash.parseint/README.md index ce3b94244..bd69bcbb9 100644 --- a/lodash.parseint/README.md +++ b/lodash.parseint/README.md @@ -1,20 +1,18 @@ -# lodash.parseint v3.0.2 +# lodash.parseint v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.parseInt` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.parseInt` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.parseint ``` -In Node.js/io.js: - +In Node.js: ```js var parseInt = require('lodash.parseint'); ``` -See the [documentation](https://lodash.com/docs#parseInt) or [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash.parseint) for more details. +See the [documentation](https://lodash.com/docs#parseInt) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.parseint) for more details. diff --git a/lodash.parseint/index.js b/lodash.parseint/index.js index 02f86b0c3..d7b2aaf49 100644 --- a/lodash.parseint/index.js +++ b/lodash.parseint/index.js @@ -1,20 +1,126 @@ /** - * lodash 3.0.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var isIterateeCall = require('lodash._isiterateecall'), - trim = require('lodash.trim'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; /** Used to detect hexadecimal string values. */ -var reHasHexPrefix = /^0[xX]/; +var reHasHexPrefix = /^0x/i; -/* Native method references for those with the same name as other `lodash` methods. */ +/** Used for built-in method references. */ +var objectProto = global.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 value references. */ +var _Symbol = global.Symbol; + +/* Built-in method references for those with the same name as other `lodash` methods. */ var nativeParseInt = global.parseInt; +/** Used to convert symbols to primitives and strings. */ +var symbolProto = _Symbol ? _Symbol.prototype : undefined, + symbolToString = _Symbol ? symbolProto.toString : undefined; + +/** + * 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 _ + * @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 _ + * @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); +} + +/** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return _Symbol ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + /** * Converts `string` to an integer of the specified radix. If `radix` is * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, @@ -28,7 +134,7 @@ var nativeParseInt = global.parseInt; * @category String * @param {string} string The string to convert. * @param {number} [radix] The radix to interpret `value` by. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. * @returns {number} Returns the converted integer. * @example * @@ -39,15 +145,14 @@ var nativeParseInt = global.parseInt; * // => [6, 8, 10] */ function parseInt(string, radix, guard) { - // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`. // Chrome fails to trim leading whitespace characters. // See https://code.google.com/p/v8/issues/detail?id=3109 for more details. - if (guard ? isIterateeCall(string, radix, guard) : radix == null) { + if (guard || radix == null) { radix = 0; } else if (radix) { radix = +radix; } - string = trim(string); + string = toString(string).replace(reTrim, ''); return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10)); } diff --git a/lodash.parseint/package.json b/lodash.parseint/package.json index fe3052f30..89c65b157 100644 --- a/lodash.parseint/package.json +++ b/lodash.parseint/package.json @@ -1,23 +1,17 @@ { "name": "lodash.parseint", - "version": "3.0.2", - "description": "The modern build of lodash’s `_.parseInt` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.parseInt` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, parseint", "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", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "dependencies": { - "lodash._isiterateecall": "^3.0.0", - "lodash.trim": "^3.0.0" - } + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } } diff --git a/lodash.partial/LICENSE.txt b/lodash.partial/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.partial/LICENSE.txt +++ b/lodash.partial/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.partial/README.md b/lodash.partial/README.md index 05231dae1..e0187bb9d 100644 --- a/lodash.partial/README.md +++ b/lodash.partial/README.md @@ -1,4 +1,4 @@ -# lodash.partial v3.0.0 +# lodash.partial v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.partial` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var partial = require('lodash.partial'); ``` -See the [documentation](https://lodash.com/docs#partial) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.partial) for more details. +See the [documentation](https://lodash.com/docs#partial) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.partial) for more details. diff --git a/lodash.partial/index.js b/lodash.partial/index.js index 0614a437d..453956ee0 100644 --- a/lodash.partial/index.js +++ b/lodash.partial/index.js @@ -1,18 +1,33 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseSlice = require('lodash._baseslice'), - createWrapper = require('lodash._createwrapper'), - replaceHolders = require('lodash._replaceholders'); +var createWrapper = require('lodash._createwrapper'), + replaceHolders = require('lodash._replaceholders'), + restParam = require('lodash.restparam'); /** Used to compose bitmasks for wrapper metadata. */ var PARTIAL_FLAG = 32; +/** + * Creates a `_.partial` or `_.partialRight` function. + * + * @private + * @param {boolean} flag The partial bit flag. + * @returns {Function} Returns the new partial function. + */ +function createPartial(flag) { + var partialFunc = restParam(function(func, partials) { + var holders = replaceHolders(partials, partialFunc.placeholder); + return createWrapper(func, flag, null, partials, holders); + }); + return partialFunc; +} + /** * Creates a function that invokes `func` with `partial` arguments prepended * to those provided to the new function. This method is like `_.bind` except @@ -21,14 +36,14 @@ var PARTIAL_FLAG = 32; * The `_.partial.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * - * **Note:** This method does not set the `length` property of partially + * **Note:** This method does not set the "length" property of partially * applied functions. * * @static * @memberOf _ * @category Function * @param {Function} func The function to partially apply arguments to. - * @param {...*} [args] The arguments to be partially applied. + * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * @@ -45,12 +60,7 @@ var PARTIAL_FLAG = 32; * greetFred('hi'); * // => 'hi fred' */ -function partial(func) { - var partials = baseSlice(arguments, 1), - holders = replaceHolders(partials, partial.placeholder); - - return createWrapper(func, PARTIAL_FLAG, null, partials, holders); -} +var partial = createPartial(PARTIAL_FLAG); // Assign default placeholders. partial.placeholder = {}; diff --git a/lodash.partial/package.json b/lodash.partial/package.json index 8b571e5b1..58dc1e71b 100644 --- a/lodash.partial/package.json +++ b/lodash.partial/package.json @@ -1,6 +1,6 @@ { "name": "lodash.partial", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.partial` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,8 +17,8 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._baseslice": "^3.0.0", "lodash._createwrapper": "^3.0.0", - "lodash._replaceholders": "^3.0.0" + "lodash._replaceholders": "^3.0.0", + "lodash.restparam": "^3.0.0" } } diff --git a/lodash.partialright/LICENSE.txt b/lodash.partialright/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.partialright/LICENSE.txt +++ b/lodash.partialright/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.partialright/README.md b/lodash.partialright/README.md index 0230784b3..848e1766f 100644 --- a/lodash.partialright/README.md +++ b/lodash.partialright/README.md @@ -1,4 +1,4 @@ -# lodash.partialright v3.0.0 +# lodash.partialright v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.partialRight` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var partialRight = require('lodash.partialright'); ``` -See the [documentation](https://lodash.com/docs#partialRight) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.partialright) for more details. +See the [documentation](https://lodash.com/docs#partialRight) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.partialright) for more details. diff --git a/lodash.partialright/index.js b/lodash.partialright/index.js index 4c7bebb59..f56d15c47 100644 --- a/lodash.partialright/index.js +++ b/lodash.partialright/index.js @@ -1,18 +1,33 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseSlice = require('lodash._baseslice'), - createWrapper = require('lodash._createwrapper'), - replaceHolders = require('lodash._replaceholders'); +var createWrapper = require('lodash._createwrapper'), + replaceHolders = require('lodash._replaceholders'), + restParam = require('lodash.restparam'); /** Used to compose bitmasks for wrapper metadata. */ var PARTIAL_RIGHT_FLAG = 64; +/** + * Creates a `_.partial` or `_.partialRight` function. + * + * @private + * @param {boolean} flag The partial bit flag. + * @returns {Function} Returns the new partial function. + */ +function createPartial(flag) { + var partialFunc = restParam(function(func, partials) { + var holders = replaceHolders(partials, partialFunc.placeholder); + return createWrapper(func, flag, null, partials, holders); + }); + return partialFunc; +} + /** * This method is like `_.partial` except that partially applied arguments * are appended to those provided to the new function. @@ -20,14 +35,14 @@ var PARTIAL_RIGHT_FLAG = 64; * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * - * **Note:** This method does not set the `length` property of partially + * **Note:** This method does not set the "length" property of partially * applied functions. * * @static * @memberOf _ * @category Function * @param {Function} func The function to partially apply arguments to. - * @param {...*} [args] The arguments to be partially applied. + * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * @@ -44,12 +59,7 @@ var PARTIAL_RIGHT_FLAG = 64; * sayHelloTo('fred'); * // => 'hello fred' */ -function partialRight(func) { - var partials = baseSlice(arguments, 1), - holders = replaceHolders(partials, partialRight.placeholder); - - return createWrapper(func, PARTIAL_RIGHT_FLAG, null, partials, holders); -} +var partialRight = createPartial(PARTIAL_RIGHT_FLAG); // Assign default placeholders. partialRight.placeholder = {}; diff --git a/lodash.partialright/package.json b/lodash.partialright/package.json index 5c1766020..6613dee78 100644 --- a/lodash.partialright/package.json +++ b/lodash.partialright/package.json @@ -1,6 +1,6 @@ { "name": "lodash.partialright", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.partialRight` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,8 +17,8 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._baseslice": "^3.0.0", "lodash._createwrapper": "^3.0.0", - "lodash._replaceholders": "^3.0.0" + "lodash._replaceholders": "^3.0.0", + "lodash.restparam": "^3.0.0" } } diff --git a/lodash.partition/LICENSE.txt b/lodash.partition/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.partition/LICENSE.txt +++ b/lodash.partition/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.partition/README.md b/lodash.partition/README.md index 88b071687..a6ac24ea3 100644 --- a/lodash.partition/README.md +++ b/lodash.partition/README.md @@ -1,4 +1,4 @@ -# lodash.partition v3.0.0 +# lodash.partition v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.partition` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var partition = require('lodash.partition'); ``` -See the [documentation](https://lodash.com/docs#partition) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.partition) for more details. +See the [documentation](https://lodash.com/docs#partition) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.partition) for more details. diff --git a/lodash.partition/index.js b/lodash.partition/index.js index 300af7ce2..cca38f306 100644 --- a/lodash.partition/index.js +++ b/lodash.partition/index.js @@ -1,12 +1,13 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var createAggregator = require('lodash._createaggregator'); +var createAggregator = require('lodash._createaggregator'), + keys = require('lodash.keys'); /** * Creates an array of elements split into two groups, the first of which diff --git a/lodash.partition/package.json b/lodash.partition/package.json index a5c7f8c94..9ef573db2 100644 --- a/lodash.partition/package.json +++ b/lodash.partition/package.json @@ -1,6 +1,6 @@ { "name": "lodash.partition", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.partition` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,7 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._createaggregator": "^3.0.0" + "lodash._createaggregator": "^3.0.0", + "lodash.keys": "^3.0.0" } } diff --git a/lodash.pick/LICENSE.txt b/lodash.pick/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.pick/LICENSE.txt +++ b/lodash.pick/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.pick/README.md b/lodash.pick/README.md index 69f30e058..09a1e3a42 100644 --- a/lodash.pick/README.md +++ b/lodash.pick/README.md @@ -1,4 +1,4 @@ -# lodash.pick v3.0.0 +# lodash.pick v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.pick` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var pick = require('lodash.pick'); ``` -See the [documentation](https://lodash.com/docs#pick) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.pick) for more details. +See the [documentation](https://lodash.com/docs#pick) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.pick) for more details. diff --git a/lodash.pick/index.js b/lodash.pick/index.js index a80ffc954..09cddce85 100644 --- a/lodash.pick/index.js +++ b/lodash.pick/index.js @@ -1,22 +1,23 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseFlatten = require('lodash._baseflatten'), bindCallback = require('lodash._bindcallback'), pickByArray = require('lodash._pickbyarray'), - pickByCallback = require('lodash._pickbycallback'); + pickByCallback = require('lodash._pickbycallback'), + restParam = require('lodash.restparam'); /** * Creates an object composed of the picked `object` properties. Property * names may be specified as individual arguments or as arrays of property - * names. If `predicate` is provided it is invoked for each property of `object` + * names. If `predicate` is provided it's invoked for each property of `object` * picking the properties `predicate` returns truthy for. The predicate is - * bound to `thisArg` and invoked with three arguments; (value, key, object). + * bound to `thisArg` and invoked with three arguments: (value, key, object). * * @static * @memberOf _ @@ -37,13 +38,13 @@ var baseFlatten = require('lodash._baseflatten'), * _.pick(object, _.isString); * // => { 'user': 'fred' } */ -function pick(object, predicate, thisArg) { +var pick = restParam(function(object, props) { if (object == null) { return {}; } - return typeof predicate == 'function' - ? pickByCallback(object, bindCallback(predicate, thisArg, 3)) - : pickByArray(object, baseFlatten(arguments, false, false, 1)); -} + return typeof props[0] == 'function' + ? pickByCallback(object, bindCallback(props[0], props[1], 3)) + : pickByArray(object, baseFlatten(props)); +}); module.exports = pick; diff --git a/lodash.pick/package.json b/lodash.pick/package.json index ceb91968a..3ff016a98 100644 --- a/lodash.pick/package.json +++ b/lodash.pick/package.json @@ -1,6 +1,6 @@ { "name": "lodash.pick", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.pick` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -20,6 +20,7 @@ "lodash._baseflatten": "^3.0.0", "lodash._bindcallback": "^3.0.0", "lodash._pickbyarray": "^3.0.0", - "lodash._pickbycallback": "^3.0.0" + "lodash._pickbycallback": "^3.0.0", + "lodash.restparam": "^3.0.0" } } diff --git a/lodash.pluck/LICENSE.txt b/lodash.pluck/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.pluck/LICENSE.txt +++ b/lodash.pluck/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.pluck/README.md b/lodash.pluck/README.md index 651e31d87..2ac2ba49d 100644 --- a/lodash.pluck/README.md +++ b/lodash.pluck/README.md @@ -1,4 +1,4 @@ -# lodash.pluck v3.0.2 +# lodash.pluck v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.pluck` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var pluck = require('lodash.pluck'); ``` -See the [documentation](https://lodash.com/docs#pluck) or [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash.pluck) for more details. +See the [documentation](https://lodash.com/docs#pluck) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.pluck) for more details. diff --git a/lodash.pluck/index.js b/lodash.pluck/index.js index b2c21227d..922d17311 100644 --- a/lodash.pluck/index.js +++ b/lodash.pluck/index.js @@ -1,22 +1,87 @@ /** - * lodash 3.0.2 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseProperty = require('lodash._baseproperty'), +var baseGet = require('lodash._baseget'), + toPath = require('lodash._topath'), + isArray = require('lodash.isarray'), map = require('lodash.map'); +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]+|(["'])(?:(?!\1)[^\n\\]|\\.)*?)\1\]/, + reIsPlainProp = /^\w*$/; + /** - * Gets the value of `key` from all elements in `collection`. + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new function. + */ +function basePropertyDeep(path) { + var pathKey = (path + ''); + path = toPath(path); + return function(object) { + return baseGet(object, path, pathKey); + }; +} + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + var type = typeof value; + if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { + return true; + } + if (isArray(value)) { + return false; + } + var result = !reIsDeepProp.test(value); + return result || (object != null && value in toObject(object)); +} + +/** + * Converts `value` to an object if it is not one. + * + * @private + * @param {*} value The value to process. + * @returns {Object} Returns the object. + */ +function toObject(value) { + return isObject(value) ? value : Object(value); +} + +/** + * Gets the property value of `path` from all elements in `collection`. * * @static * @memberOf _ * @category Collection * @param {Array|Object|string} collection The collection to iterate over. - * @param {string} key The key of the property to pluck. + * @param {Array|string} path The path of the property to pluck. * @returns {Array} Returns the property values. * @example * @@ -32,8 +97,61 @@ var baseProperty = require('lodash._baseproperty'), * _.pluck(userIndex, 'age'); * // => [36, 40] (iteration order is not guaranteed) */ -function pluck(collection, key) { - return map(collection, baseProperty(key)); +function pluck(collection, path) { + return map(collection, property(path)); +} + +/** + * 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(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return type == 'function' || (!!value && type == 'object'); +} + +/** + * Creates a function which returns the property value at `path` on a + * given object. + * + * @static + * @memberOf _ + * @category Utility + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new function. + * @example + * + * var objects = [ + * { 'a': { 'b': { 'c': 2 } } }, + * { 'a': { 'b': { 'c': 1 } } } + * ]; + * + * _.map(objects, _.property('a.b.c')); + * // => [2, 1] + * + * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(path) : basePropertyDeep(path); } module.exports = pluck; diff --git a/lodash.pluck/package.json b/lodash.pluck/package.json index ec3ff4914..412dd0b96 100644 --- a/lodash.pluck/package.json +++ b/lodash.pluck/package.json @@ -1,6 +1,6 @@ { "name": "lodash.pluck", - "version": "3.0.2", + "version": "3.1.0", "description": "The modern build of lodash’s `_.pluck` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,7 +17,9 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._baseproperty": "^3.0.0", + "lodash._baseget": "^3.0.0", + "lodash._topath": "^3.0.0", + "lodash.isarray": "^3.0.0", "lodash.map": "^3.0.0" } } diff --git a/lodash.property/LICENSE.txt b/lodash.property/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.property/LICENSE.txt +++ b/lodash.property/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.property/README.md b/lodash.property/README.md index 7af8e3f47..694b5758c 100644 --- a/lodash.property/README.md +++ b/lodash.property/README.md @@ -1,4 +1,4 @@ -# lodash.property v3.0.0 +# lodash.property v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.property` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var property = require('lodash.property'); ``` -See the [documentation](https://lodash.com/docs#property) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.property) for more details. +See the [documentation](https://lodash.com/docs#property) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.property) for more details. diff --git a/lodash.property/index.js b/lodash.property/index.js index 4a0d56f26..cba9b5a37 100644 --- a/lodash.property/index.js +++ b/lodash.property/index.js @@ -1,38 +1,129 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseProperty = require('lodash._baseproperty'); +var baseGet = require('lodash._baseget'), + toPath = require('lodash._topath'), + isArray = require('lodash.isarray'); + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]+|(["'])(?:(?!\1)[^\n\\]|\\.)*?)\1\]/, + reIsPlainProp = /^\w*$/; /** - * Creates a function which returns the property value of `key` on a given object. + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new function. + */ +function basePropertyDeep(path) { + var pathKey = (path + ''); + path = toPath(path); + return function(object) { + return baseGet(object, path, pathKey); + }; +} + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + var type = typeof value; + if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { + return true; + } + if (isArray(value)) { + return false; + } + var result = !reIsDeepProp.test(value); + return result || (object != null && value in toObject(object)); +} + +/** + * Converts `value` to an object if it is not one. + * + * @private + * @param {*} value The value to process. + * @returns {Object} Returns the object. + */ +function toObject(value) { + return isObject(value) ? value : Object(value); +} + +/** + * 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(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return type == 'function' || (!!value && type == 'object'); +} + +/** + * Creates a function which returns the property value at `path` on a + * given object. * * @static * @memberOf _ * @category Utility - * @param {string} key The key of the property to get. + * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new function. * @example * - * var users = [ - * { 'user': 'fred' }, - * { 'user': 'barney' } + * var objects = [ + * { 'a': { 'b': { 'c': 2 } } }, + * { 'a': { 'b': { 'c': 1 } } } * ]; * - * var getName = _.property('user'); + * _.map(objects, _.property('a.b.c')); + * // => [2, 1] * - * _.map(users, getName); - * // => ['fred', 'barney'] - * - * _.pluck(_.sortBy(users, getName), 'user'); - * // => ['barney', 'fred'] + * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); + * // => [1, 2] */ -function property(key) { - return baseProperty(key + ''); +function property(path) { + return isKey(path) ? baseProperty(path) : basePropertyDeep(path); } module.exports = property; diff --git a/lodash.property/package.json b/lodash.property/package.json index d3bf41d31..96c32d079 100644 --- a/lodash.property/package.json +++ b/lodash.property/package.json @@ -1,6 +1,6 @@ { "name": "lodash.property", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.property` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,8 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._baseproperty": "^3.0.0" + "lodash._baseget": "^3.0.0", + "lodash._topath": "^3.0.0", + "lodash.isarray": "^3.0.0" } } diff --git a/lodash.propertyof/LICENSE.txt b/lodash.propertyof/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.propertyof/LICENSE.txt +++ b/lodash.propertyof/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.propertyof/README.md b/lodash.propertyof/README.md index 85b68e57e..40aac9cac 100644 --- a/lodash.propertyof/README.md +++ b/lodash.propertyof/README.md @@ -1,4 +1,4 @@ -# lodash.propertyof v3.0.0 +# lodash.propertyof v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.propertyOf` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var propertyOf = require('lodash.propertyof'); ``` -See the [documentation](https://lodash.com/docs#propertyOf) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.propertyof) for more details. +See the [documentation](https://lodash.com/docs#propertyOf) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.propertyof) for more details. diff --git a/lodash.propertyof/index.js b/lodash.propertyof/index.js index 4f6e47f96..cf54c44e9 100644 --- a/lodash.propertyof/index.js +++ b/lodash.propertyof/index.js @@ -1,34 +1,37 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ +var baseGet = require('lodash._baseget'), + toPath = require('lodash._topath'); /** - * The inverse of `_.property`; this method creates a function which returns - * the property value of a given key on `object`. + * The opposite of `_.property`; this method creates a function that returns + * the property value at a given path on `object`. * * @static * @memberOf _ * @category Utility - * @param {Object} object The object to inspect. + * @param {Object} object The object to query. * @returns {Function} Returns the new function. * @example * - * var object = { 'a': 3, 'b': 1, 'c': 2 }; + * var array = [0, 1, 2], + * object = { 'a': array, 'b': array, 'c': array }; * - * _.map(['a', 'c'], _.propertyOf(object)); - * // => [3, 2] + * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); + * // => [2, 0] * - * _.sortBy(['a', 'b', 'c'], _.propertyOf(object)); - * // => ['b', 'c', 'a'] + * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); + * // => [2, 0] */ function propertyOf(object) { - return function(key) { - return object == null ? undefined : object[key]; + return function(path) { + return baseGet(object, toPath(path), (path + '')); }; } diff --git a/lodash.propertyof/package.json b/lodash.propertyof/package.json index d32c05c36..bf09a24df 100644 --- a/lodash.propertyof/package.json +++ b/lodash.propertyof/package.json @@ -1,6 +1,6 @@ { "name": "lodash.propertyof", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.propertyOf` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -15,5 +15,9 @@ "Mathias Bynens (https://mathiasbynens.be/)" ], "repository": "lodash/lodash", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, + "dependencies": { + "lodash._baseget": "^3.0.0", + "lodash._topath": "^3.0.0" + } } diff --git a/lodash.pullat/LICENSE.txt b/lodash.pullat/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.pullat/LICENSE.txt +++ b/lodash.pullat/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.pullat/README.md b/lodash.pullat/README.md index 7c94640e4..81352c16e 100644 --- a/lodash.pullat/README.md +++ b/lodash.pullat/README.md @@ -1,4 +1,4 @@ -# lodash.pullat v3.0.0 +# lodash.pullat v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.pullAt` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var pullAt = require('lodash.pullat'); ``` -See the [documentation](https://lodash.com/docs#pullAt) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.pullat) for more details. +See the [documentation](https://lodash.com/docs#pullAt) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.pullat) for more details. diff --git a/lodash.pullat/index.js b/lodash.pullat/index.js index 53c80894d..95fcdd920 100644 --- a/lodash.pullat/index.js +++ b/lodash.pullat/index.js @@ -1,14 +1,15 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseAt = require('lodash._baseat'), baseCompareAscending = require('lodash._basecompareascending'), - baseFlatten = require('lodash._baseflatten'); + baseFlatten = require('lodash._baseflatten'), + restParam = require('lodash.restparam'); /** Used for native method references. */ var arrayProto = Array.prototype; @@ -17,36 +18,11 @@ var arrayProto = Array.prototype; var splice = arrayProto.splice; /** - * Used as the maximum length of an array-like value. - * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) - * for more details. + * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) + * of an array-like value. */ var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; -/** - * The base implementation of `_.pullAt` without support for individual - * index arguments. - * - * @private - * @param {Array} array The array to modify. - * @param {number[]} indexes The indexes of elements to remove. - * @returns {Array} Returns the new array of removed elements. - */ -function basePullAt(array, indexes) { - var length = indexes.length, - result = baseAt(array, indexes); - - indexes.sort(baseCompareAscending); - while (length--) { - var index = parseFloat(indexes[length]); - if (index != previous && isIndex(index)) { - var previous = index; - splice.call(array, index, 1); - } - } - return result; -} - /** * Checks if `value` is a valid array-like index. * @@ -86,8 +62,22 @@ function isIndex(value, length) { * console.log(evens); * // => [10, 20] */ -function pullAt(array) { - return basePullAt(array || [], baseFlatten(arguments, false, false, 1)); -} +var pullAt = restParam(function(array, indexes) { + array || (array = []); + indexes = baseFlatten(indexes); + + var length = indexes.length, + result = baseAt(array, indexes); + + indexes.sort(baseCompareAscending); + while (length--) { + var index = parseFloat(indexes[length]); + if (index != previous && isIndex(index)) { + var previous = index; + splice.call(array, index, 1); + } + } + return result; +}); module.exports = pullAt; diff --git a/lodash.pullat/package.json b/lodash.pullat/package.json index 16e20622f..cb0362b0f 100644 --- a/lodash.pullat/package.json +++ b/lodash.pullat/package.json @@ -1,6 +1,6 @@ { "name": "lodash.pullat", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.pullAt` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -19,6 +19,7 @@ "dependencies": { "lodash._baseat": "^3.0.0", "lodash._basecompareascending": "^3.0.0", - "lodash._baseflatten": "^3.0.0" + "lodash._baseflatten": "^3.0.0", + "lodash.restparam": "^3.0.0" } } diff --git a/lodash.random/LICENSE b/lodash.random/LICENSE index 9cd87e5dc..b054ca5a3 100644 --- a/lodash.random/LICENSE +++ b/lodash.random/LICENSE @@ -1,5 +1,5 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.random/README.md b/lodash.random/README.md index 2ab1c0393..7976dd6de 100644 --- a/lodash.random/README.md +++ b/lodash.random/README.md @@ -1,20 +1,18 @@ -# lodash.random v3.0.1 +# lodash.random v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.random` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.random` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.random ``` -In Node.js/io.js: - +In Node.js: ```js var random = require('lodash.random'); ``` -See the [documentation](https://lodash.com/docs#random) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.random) for more details. +See the [documentation](https://lodash.com/docs#random) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.random) for more details. diff --git a/lodash.random/index.js b/lodash.random/index.js index ccf53c71b..64ea7d496 100644 --- a/lodash.random/index.js +++ b/lodash.random/index.js @@ -1,29 +1,322 @@ /** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseRandom = require('lodash._baserandom'), - isIterateeCall = require('lodash._isiterateecall'); -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min, +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991, + 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; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Built-in method references without a dependency on `global`. */ +var freeParseFloat = parseFloat, + freeParseInt = parseInt; + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; +} + +/** Used for built-in method references. */ +var objectProto = global.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 nativeFloor = Math.floor, + nativeMin = Math.min, nativeRandom = Math.random; /** - * Produces a random number between `min` and `max` (inclusive). If only one - * argument is provided a number between `0` and the given number is returned. - * If `floating` is `true`, or either `min` or `max` are floats, a floating-point - * number is returned instead of an integer. + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ +function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); +} + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +/** + * Checks if the provided arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object)) { + return eq(object[index], value); + } + return false; +} + +/** + * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @type Function + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && + !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value)); +} + +/** + * 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 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 a valid array-like length. + * + * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * 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); +} + +/** + * Produces a random number between the inclusive `lower` and `upper` bounds. + * If only one argument is provided a number between `0` and the given number + * is returned. If `floating` is `true`, or either `lower` or `upper` are floats, + * a floating-point number is returned instead of an integer. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. * * @static * @memberOf _ * @category Number - * @param {number} [min=0] The minimum possible value. - * @param {number} [max=1] The maximum possible value. + * @param {number} [lower=0] The lower bound. + * @param {number} [upper=1] The upper bound. * @param {boolean} [floating] Specify returning a floating-point number. * @returns {number} Returns the random number. * @example @@ -40,39 +333,43 @@ var nativeMin = Math.min, * _.random(1.2, 5.2); * // => a floating-point number between 1.2 and 5.2 */ -function random(min, max, floating) { - if (floating && isIterateeCall(min, max, floating)) { - max = floating = undefined; +function random(lower, upper, floating) { + if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined; } - var noMin = min == null, - noMax = max == null; - - if (floating == null) { - if (noMax && typeof min == 'boolean') { - floating = min; - min = 1; + if (floating === undefined) { + if (typeof upper == 'boolean') { + floating = upper; + upper = undefined; } - else if (typeof max == 'boolean') { - floating = max; - noMax = true; + else if (typeof lower == 'boolean') { + floating = lower; + lower = undefined; } } - if (noMin && noMax) { - max = 1; - noMax = false; + if (lower === undefined && upper === undefined) { + lower = 0; + upper = 1; } - min = +min || 0; - if (noMax) { - max = min; - min = 0; - } else { - max = +max || 0; + else { + lower = toNumber(lower) || 0; + if (upper === undefined) { + upper = lower; + lower = 0; + } else { + upper = toNumber(upper) || 0; + } } - if (floating || min % 1 || max % 1) { + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { var rand = nativeRandom(); - return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max); + return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); } - return baseRandom(min, max); + return baseRandom(lower, upper); } module.exports = random; diff --git a/lodash.random/package.json b/lodash.random/package.json index d39a39375..e913ca525 100644 --- a/lodash.random/package.json +++ b/lodash.random/package.json @@ -1,23 +1,17 @@ { "name": "lodash.random", - "version": "3.0.1", - "description": "The modern build of lodash’s `_.random` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.random` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, random", "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", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "dependencies": { - "lodash._baserandom": "^3.0.0", - "lodash._isiterateecall": "^3.0.0" - } + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } } diff --git a/lodash.range/LICENSE b/lodash.range/LICENSE index 9cd87e5dc..b054ca5a3 100644 --- a/lodash.range/LICENSE +++ b/lodash.range/LICENSE @@ -1,5 +1,5 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.range/README.md b/lodash.range/README.md index 9aa703b4b..d250feda7 100644 --- a/lodash.range/README.md +++ b/lodash.range/README.md @@ -1,20 +1,18 @@ -# lodash.range v3.0.1 +# lodash.range v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.range` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.range` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.range ``` -In Node.js/io.js: - +In Node.js: ```js var range = require('lodash.range'); ``` -See the [documentation](https://lodash.com/docs#range) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.range) for more details. +See the [documentation](https://lodash.com/docs#range) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.range) for more details. diff --git a/lodash.range/index.js b/lodash.range/index.js index 07c51b472..cc417f02e 100644 --- a/lodash.range/index.js +++ b/lodash.range/index.js @@ -1,26 +1,354 @@ /** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var isIterateeCall = require('lodash._isiterateecall'); -/* Native method references for those with the same name as other `lodash` methods. */ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991, + 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; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Built-in method references without a dependency on `global`. */ +var freeParseInt = parseInt; + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; +} + +/** Used for built-in method references. */ +var objectProto = global.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 nativeCeil = Math.ceil, nativeMax = Math.max; /** - * Creates an array of numbers (positive and/or negative) progressing from - * `start` up to, but not including, `end`. If `end` is not specified it's - * set to `start` with `start` then set to `0`. If `end` is less than `start` - * a zero-length range is created unless a negative `step` is specified. + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments to numbers. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the new array of numbers. + */ +function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; +} + +/** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ +function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toNumber(start); + start = start === start ? start : 0; + if (end === undefined) { + end = start; + start = 0; + } else { + end = toNumber(end) || 0; + } + step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0); + return baseRange(start, end, step, fromRight); + }; +} + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +/** + * Checks if the provided arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object)) { + return eq(object[index], value); + } + return false; +} + +/** + * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ - * @category Utility + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @type Function + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && + !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value)); +} + +/** + * 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 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 a valid array-like length. + * + * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * 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); +} + +/** + * Creates an array of numbers (positive and/or negative) progressing from + * `start` up to, but not including, `end`. A step of `-1` is used if a negative + * `start` is specified without an `end` or `step`. If `end` is not specified + * it's set to `start` with `start` then set to `0`. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. + * + * @static + * @memberOf _ + * @category Util * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @param {number} [step=1] The value to increment or decrement by. @@ -30,6 +358,9 @@ var nativeCeil = Math.ceil, * _.range(4); * // => [0, 1, 2, 3] * + * _.range(-4); + * // => [0, -1, -2, -3] + * * _.range(1, 5); * // => [1, 2, 3, 4] * @@ -45,30 +376,6 @@ var nativeCeil = Math.ceil, * _.range(0); * // => [] */ -function range(start, end, step) { - if (step && isIterateeCall(start, end, step)) { - end = step = undefined; - } - start = +start || 0; - step = step == null ? 1 : (+step || 0); - - if (end == null) { - end = start; - start = 0; - } else { - end = +end || 0; - } - // Use `Array(length)` so engines like Chakra and V8 avoid slower modes. - // See https://youtu.be/XAqIpGU8ZZk#t=17m25s for more details. - var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); - - while (++index < length) { - result[index] = start; - start += step; - } - return result; -} +var range = createRange(); module.exports = range; diff --git a/lodash.range/package.json b/lodash.range/package.json index 71264d023..8c49232b0 100644 --- a/lodash.range/package.json +++ b/lodash.range/package.json @@ -1,22 +1,17 @@ { "name": "lodash.range", - "version": "3.0.1", - "description": "The modern build of lodash’s `_.range` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.range` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, range", "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", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "dependencies": { - "lodash._isiterateecall": "^3.0.0" - } + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } } diff --git a/lodash.rearg/LICENSE.txt b/lodash.rearg/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.rearg/LICENSE.txt +++ b/lodash.rearg/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.rearg/README.md b/lodash.rearg/README.md index b3f2db24b..efd356cdb 100644 --- a/lodash.rearg/README.md +++ b/lodash.rearg/README.md @@ -1,4 +1,4 @@ -# lodash.rearg v3.0.0 +# lodash.rearg v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.rearg` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var rearg = require('lodash.rearg'); ``` -See the [documentation](https://lodash.com/docs#rearg) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.rearg) for more details. +See the [documentation](https://lodash.com/docs#rearg) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.rearg) for more details. diff --git a/lodash.rearg/index.js b/lodash.rearg/index.js index baaf6f0e7..c86446d5d 100644 --- a/lodash.rearg/index.js +++ b/lodash.rearg/index.js @@ -1,16 +1,17 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseFlatten = require('lodash._baseflatten'), - createWrapper = require('lodash._createwrapper'); + createWrapper = require('lodash._createwrapper'), + restParam = require('lodash.restparam'); /** Used to compose bitmasks for wrapper metadata. */ -var REARG_FLAG = 128; +var REARG_FLAG = 256; /** * Creates a function that invokes `func` with arguments arranged according @@ -40,9 +41,8 @@ var REARG_FLAG = 128; * }, [1, 2, 3]); * // => [3, 6, 9] */ -function rearg(func) { - var indexes = baseFlatten(arguments, false, false, 1); - return createWrapper(func, REARG_FLAG, null, null, null, indexes); -} +var rearg = restParam(function(func, indexes) { + return createWrapper(func, REARG_FLAG, null, null, null, baseFlatten(indexes)); +}); module.exports = rearg; diff --git a/lodash.rearg/package.json b/lodash.rearg/package.json index 1de43a521..a90a3b4b5 100644 --- a/lodash.rearg/package.json +++ b/lodash.rearg/package.json @@ -1,6 +1,6 @@ { "name": "lodash.rearg", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.rearg` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,6 +18,7 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._baseflatten": "^3.0.0", - "lodash._createwrapper": "^3.0.0" + "lodash._createwrapper": "^3.0.0", + "lodash.restparam": "^3.0.0" } } diff --git a/lodash.reduce/README.md b/lodash.reduce/README.md index 2d6f33cb1..1894484d7 100644 --- a/lodash.reduce/README.md +++ b/lodash.reduce/README.md @@ -1,4 +1,4 @@ -# lodash.reduce v3.0.1 +# lodash.reduce v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.reduce` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var reduce = require('lodash.reduce'); ``` -See the [documentation](https://lodash.com/docs#reduce) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.reduce) for more details. +See the [documentation](https://lodash.com/docs#reduce) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.reduce) for more details. diff --git a/lodash.reduce/index.js b/lodash.reduce/index.js index f566fa25b..311191dbc 100644 --- a/lodash.reduce/index.js +++ b/lodash.reduce/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.2 @@ -9,7 +9,8 @@ var baseCallback = require('lodash._basecallback'), baseEach = require('lodash._baseeach'), baseReduce = require('lodash._basereduce'), - isArray = require('lodash.isarray'); + isArray = require('lodash.isarray'), + keys = require('lodash.keys'); /** * A specialized version of `_.reduce` for arrays without support for callback diff --git a/lodash.reduce/package.json b/lodash.reduce/package.json index 50762cb0d..6897819d4 100644 --- a/lodash.reduce/package.json +++ b/lodash.reduce/package.json @@ -1,6 +1,6 @@ { "name": "lodash.reduce", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s `_.reduce` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -20,6 +20,7 @@ "lodash._basecallback": "^3.0.0", "lodash._baseeach": "^3.0.0", "lodash._basereduce": "^3.0.0", - "lodash.isarray": "^3.0.0" + "lodash.isarray": "^3.0.0", + "lodash.keys": "^3.0.0" } } diff --git a/lodash.reduceright/README.md b/lodash.reduceright/README.md index 620a341e4..65611e40d 100644 --- a/lodash.reduceright/README.md +++ b/lodash.reduceright/README.md @@ -1,4 +1,4 @@ -# lodash.reduceright v3.0.1 +# lodash.reduceright v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.reduceRight` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var reduceRight = require('lodash.reduceright'); ``` -See the [documentation](https://lodash.com/docs#reduceRight) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.reduceright) for more details. +See the [documentation](https://lodash.com/docs#reduceRight) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.reduceright) for more details. diff --git a/lodash.reduceright/index.js b/lodash.reduceright/index.js index f0c91bdf0..91eb56089 100644 --- a/lodash.reduceright/index.js +++ b/lodash.reduceright/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.2 @@ -9,7 +9,8 @@ var baseCallback = require('lodash._basecallback'), baseEachRight = require('lodash._baseeachright'), baseReduce = require('lodash._basereduce'), - isArray = require('lodash.isarray'); + isArray = require('lodash.isarray'), + keys = require('lodash.keys'); /** * A specialized version of `_.reduceRight` for arrays without support for diff --git a/lodash.reduceright/package.json b/lodash.reduceright/package.json index d65033483..89ecd3d73 100644 --- a/lodash.reduceright/package.json +++ b/lodash.reduceright/package.json @@ -1,6 +1,6 @@ { "name": "lodash.reduceright", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s `_.reduceRight` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -20,6 +20,7 @@ "lodash._basecallback": "^3.0.0", "lodash._baseeachright": "^3.0.0", "lodash._basereduce": "^3.0.0", - "lodash.isarray": "^3.0.0" + "lodash.isarray": "^3.0.0", + "lodash.keys": "^3.0.0" } } diff --git a/lodash.reject/LICENSE.txt b/lodash.reject/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.reject/LICENSE.txt +++ b/lodash.reject/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.reject/README.md b/lodash.reject/README.md index 4a3756ec3..5f089325c 100644 --- a/lodash.reject/README.md +++ b/lodash.reject/README.md @@ -1,4 +1,4 @@ -# lodash.reject v3.0.0 +# lodash.reject v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.reject` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var reject = require('lodash.reject'); ``` -See the [documentation](https://lodash.com/docs#reject) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.reject) for more details. +See the [documentation](https://lodash.com/docs#reject) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.reject) for more details. diff --git a/lodash.reject/index.js b/lodash.reject/index.js index 71735b504..3375a02c2 100644 --- a/lodash.reject/index.js +++ b/lodash.reject/index.js @@ -1,31 +1,21 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var arrayFilter = require('lodash._arrayfilter'), baseCallback = require('lodash._basecallback'), baseFilter = require('lodash._basefilter'), - isArray = require('lodash.isarray'); + isArray = require('lodash.isarray'), + keys = require('lodash.keys'); /** * The opposite of `_.filter`; this method returns the elements of `collection` * that `predicate` does **not** return truthy for. * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * * @static * @memberOf _ * @category Collection diff --git a/lodash.reject/package.json b/lodash.reject/package.json index ebe875b70..c9780cb4e 100644 --- a/lodash.reject/package.json +++ b/lodash.reject/package.json @@ -1,6 +1,6 @@ { "name": "lodash.reject", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.reject` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -20,6 +20,7 @@ "lodash._arrayfilter": "^3.0.0", "lodash._basecallback": "^3.0.0", "lodash._basefilter": "^3.0.0", - "lodash.isarray": "^3.0.0" + "lodash.isarray": "^3.0.0", + "lodash.keys": "^3.0.0" } } diff --git a/lodash.remove/README.md b/lodash.remove/README.md index 1cb6ae020..02fb88a2e 100644 --- a/lodash.remove/README.md +++ b/lodash.remove/README.md @@ -1,4 +1,4 @@ -# lodash.remove v3.0.1 +# lodash.remove v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.remove` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var remove = require('lodash.remove'); ``` -See the [documentation](https://lodash.com/docs#remove) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.remove) for more details. +See the [documentation](https://lodash.com/docs#remove) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.remove) for more details. diff --git a/lodash.remove/index.js b/lodash.remove/index.js index 7f440bde3..a863db525 100644 --- a/lodash.remove/index.js +++ b/lodash.remove/index.js @@ -1,59 +1,13 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseCallback = require('lodash._basecallback'); - -/** Used for native method references. */ -var arrayProto = Array.prototype; - -/** Native method references. */ -var splice = arrayProto.splice; - -/** - * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) - * of an array-like value. - */ -var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; - -/** - * The base implementation of `_.pullAt` without support for individual - * index arguments and capturing the removed elements. - * - * @private - * @param {Array} array The array to modify. - * @param {number[]} indexes The indexes of elements to remove. - * @returns {Array} Returns `array`. - */ -function basePullAt(array, indexes) { - var length = indexes.length; - while (length--) { - var index = parseFloat(indexes[length]); - if (index != previous && isIndex(index)) { - var previous = index; - splice.call(array, index, 1); - } - } - return array; -} - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - value = +value; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; -} +var baseCallback = require('lodash._basecallback'), + basePullAt = require('lodash._basepullat'); /** * Removes all elements from `array` that `predicate` returns truthy for diff --git a/lodash.remove/package.json b/lodash.remove/package.json index 4d5285d1b..45a5410e5 100644 --- a/lodash.remove/package.json +++ b/lodash.remove/package.json @@ -1,6 +1,6 @@ { "name": "lodash.remove", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s `_.remove` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,7 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._basecallback": "^3.0.0" + "lodash._basecallback": "^3.0.0", + "lodash._basepullat": "^3.0.0" } } diff --git a/lodash.repeat/LICENSE b/lodash.repeat/LICENSE index 9cd87e5dc..b054ca5a3 100644 --- a/lodash.repeat/LICENSE +++ b/lodash.repeat/LICENSE @@ -1,5 +1,5 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.repeat/README.md b/lodash.repeat/README.md index dec571a33..a911d9909 100644 --- a/lodash.repeat/README.md +++ b/lodash.repeat/README.md @@ -1,20 +1,18 @@ -# lodash.repeat v3.0.1 +# lodash.repeat v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.repeat` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.repeat` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.repeat ``` -In Node.js/io.js: - +In Node.js: ```js var repeat = require('lodash.repeat'); ``` -See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.repeat) for more details. +See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.repeat) for more details. diff --git a/lodash.repeat/index.js b/lodash.repeat/index.js index 367913f56..85a5a90b3 100644 --- a/lodash.repeat/index.js +++ b/lodash.repeat/index.js @@ -1,16 +1,267 @@ /** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseToString = require('lodash._basetostring'); -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeFloor = Math.floor, - nativeIsFinite = global.isFinite; +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + symbolTag = '[object Symbol]'; + +/** 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 `global`. */ +var freeParseInt = parseInt; + +/** Used for built-in method references. */ +var objectProto = global.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 value references. */ +var _Symbol = global.Symbol; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = _Symbol ? _Symbol.prototype : undefined, + symbolToString = _Symbol ? symbolProto.toString : undefined; + +/** + * 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 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) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * 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 _ + * @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 _ + * @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); +} + +/** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ +function toInteger(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + var remainder = value % 1; + return value === value ? (remainder ? value - remainder : value) : 0; +} + +/** + * 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); +} + +/** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return _Symbol ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} /** * Repeats the given string `n` times. @@ -33,10 +284,11 @@ var nativeFloor = Math.floor, * // => '' */ function repeat(string, n) { + string = toString(string); + n = toInteger(n); + var result = ''; - string = baseToString(string); - n = +n; - if (n < 1 || !string || !nativeIsFinite(n)) { + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { return result; } // Leverage the exponentiation by squaring algorithm for a faster repeat. diff --git a/lodash.repeat/package.json b/lodash.repeat/package.json index 9268878ce..1ea3bd377 100644 --- a/lodash.repeat/package.json +++ b/lodash.repeat/package.json @@ -1,22 +1,17 @@ { "name": "lodash.repeat", - "version": "3.0.1", - "description": "The modern build of lodash’s `_.repeat` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.repeat` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, repeat", "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", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "dependencies": { - "lodash._basetostring": "^3.0.0" - } + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } } diff --git a/lodash.result/LICENSE.txt b/lodash.result/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.result/LICENSE.txt +++ b/lodash.result/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.result/README.md b/lodash.result/README.md index 5fbf5222f..ccba904db 100644 --- a/lodash.result/README.md +++ b/lodash.result/README.md @@ -1,4 +1,4 @@ -# lodash.result v3.0.0 +# lodash.result v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.result` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var result = require('lodash.result'); ``` -See the [documentation](https://lodash.com/docs#result) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.result) for more details. +See the [documentation](https://lodash.com/docs#result) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.result) for more details. diff --git a/lodash.result/index.js b/lodash.result/index.js index e216f4831..45ca74eb0 100644 --- a/lodash.result/index.js +++ b/lodash.result/index.js @@ -1,49 +1,136 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var isFunction = require('lodash.isfunction'); +var baseGet = require('lodash._baseget'), + baseSlice = require('lodash._baseslice'), + toPath = require('lodash._topath'), + isArray = require('lodash.isarray'), + isFunction = require('lodash.isfunction'); + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]+|(["'])(?:(?!\1)[^\n\\]|\\.)*?)\1\]/, + reIsPlainProp = /^\w*$/; /** - * Resolves the value of property `key` on `object`. If the value of `key` is - * a function it is invoked with the `this` binding of `object` and its result - * is returned, else the property value is returned. If the property value is - * `undefined` the `defaultValue` is used in its place. + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + var type = typeof value; + if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { + return true; + } + if (isArray(value)) { + return false; + } + var result = !reIsDeepProp.test(value); + return result || (object != null && value in toObject(object)); +} + +/** + * Converts `value` to an object if it is not one. + * + * @private + * @param {*} value The value to process. + * @returns {Object} Returns the object. + */ +function toObject(value) { + return isObject(value) ? value : Object(value); +} + +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array ? array.length : 0; + return length ? array[length - 1] : undefined; +} + +/** + * 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(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return type == 'function' || (!!value && type == 'object'); +} + +/** + * This method is like `_.get` except that if the resolved value is a function + * it is invoked with the `this` binding of its parent object and its result + * is returned. * * @static * @memberOf _ * @category Object * @param {Object} object The object to query. - * @param {string} key The key of the property to resolve. - * @param {*} [defaultValue] The value returned if the property value - * resolves to `undefined`. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. * @returns {*} Returns the resolved value. * @example * - * var object = { 'user': 'fred', 'age': _.constant(40) }; + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; * - * _.result(object, 'user'); - * // => 'fred' + * _.result(object, 'a[0].b.c1'); + * // => 3 * - * _.result(object, 'age'); - * // => 40 + * _.result(object, 'a[0].b.c2'); + * // => 4 * - * _.result(object, 'status', 'busy'); - * // => 'busy' + * _.result(object, 'a.b.c', 'default'); + * // => 'default' * - * _.result(object, 'status', _.constant('busy')); - * // => 'busy' + * _.result(object, 'a.b.c', _.constant('default')); + * // => 'default' */ -function result(object, key, defaultValue) { - var value = object == null ? undefined : object[key]; - if (typeof value == 'undefined') { - value = defaultValue; +function result(object, path, defaultValue) { + var result = object == null ? undefined : object[path]; + if (result === undefined) { + if (object != null && !isKey(path, object)) { + path = toPath(path); + object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); + result = object == null ? undefined : object[last(path)]; + } + result = result === undefined ? defaultValue : result; } - return isFunction(value) ? value.call(object) : value; + return isFunction(result) ? result.call(object) : result; } module.exports = result; diff --git a/lodash.result/package.json b/lodash.result/package.json index b95bad776..9bd68db00 100644 --- a/lodash.result/package.json +++ b/lodash.result/package.json @@ -1,6 +1,6 @@ { "name": "lodash.result", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.result` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,10 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { + "lodash._baseget": "^3.0.0", + "lodash._baseslice": "^3.0.0", + "lodash._topath": "^3.0.0", + "lodash.isarray": "^3.0.0", "lodash.isfunction": "^3.0.0" } } diff --git a/lodash.sample/LICENSE.txt b/lodash.sample/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.sample/LICENSE.txt +++ b/lodash.sample/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.sample/README.md b/lodash.sample/README.md index 4377da2c1..8fcb26926 100644 --- a/lodash.sample/README.md +++ b/lodash.sample/README.md @@ -1,4 +1,4 @@ -# lodash.sample v3.0.0 +# lodash.sample v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.sample` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var sample = require('lodash.sample'); ``` -See the [documentation](https://lodash.com/docs#sample) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.sample) for more details. +See the [documentation](https://lodash.com/docs#sample) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.sample) for more details. diff --git a/lodash.sample/index.js b/lodash.sample/index.js index d07df43bb..7df18cb95 100644 --- a/lodash.sample/index.js +++ b/lodash.sample/index.js @@ -1,15 +1,15 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseRandom = require('lodash._baserandom'), isIterateeCall = require('lodash._isiterateecall'), toIterable = require('lodash._toiterable'), - shuffle = require('lodash.shuffle'); + toArray = require('lodash.toarray'); /* Native method references for those with the same name as other `lodash` methods. */ var nativeMin = Math.min; @@ -38,8 +38,20 @@ function sample(collection, n, guard) { var length = collection.length; return length > 0 ? collection[baseRandom(0, length - 1)] : undefined; } - var result = shuffle(collection); - result.length = nativeMin(n < 0 ? 0 : (+n || 0), result.length); + var index = -1, + result = toArray(collection), + length = result.length, + lastIndex = length - 1; + + n = nativeMin(n < 0 ? 0 : (+n || 0), length); + while (++index < n) { + var rand = baseRandom(index, lastIndex), + value = result[rand]; + + result[rand] = result[index]; + result[index] = value; + } + result.length = n; return result; } diff --git a/lodash.sample/package.json b/lodash.sample/package.json index d9daab329..722842a7d 100644 --- a/lodash.sample/package.json +++ b/lodash.sample/package.json @@ -1,6 +1,6 @@ { "name": "lodash.sample", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.sample` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -20,6 +20,7 @@ "lodash._baserandom": "^3.0.0", "lodash._isiterateecall": "^3.0.0", "lodash._toiterable": "^3.0.0", - "lodash.shuffle": "^3.0.0" + "lodash.toarray": "^3.0.0", + "lodash.values": "^3.0.0" } } diff --git a/lodash.shuffle/LICENSE.txt b/lodash.shuffle/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.shuffle/LICENSE.txt +++ b/lodash.shuffle/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.shuffle/README.md b/lodash.shuffle/README.md index 5f7dae41a..59c64e02d 100644 --- a/lodash.shuffle/README.md +++ b/lodash.shuffle/README.md @@ -1,4 +1,4 @@ -# lodash.shuffle v3.0.0 +# lodash.shuffle v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.shuffle` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var shuffle = require('lodash.shuffle'); ``` -See the [documentation](https://lodash.com/docs#shuffle) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.shuffle) for more details. +See the [documentation](https://lodash.com/docs#shuffle) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.shuffle) for more details. diff --git a/lodash.shuffle/index.js b/lodash.shuffle/index.js index 9128dfc10..baf3c97b9 100644 --- a/lodash.shuffle/index.js +++ b/lodash.shuffle/index.js @@ -1,13 +1,15 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseRandom = require('lodash._baserandom'), - toIterable = require('lodash._toiterable'); +var sample = require('lodash.sample'); + +/** Used as references for `-Infinity` and `Infinity`. */ +var POSITIVE_INFINITY = Number.POSITIVE_INFINITY; /** * Creates an array of shuffled values, using a version of the @@ -24,20 +26,7 @@ var baseRandom = require('lodash._baserandom'), * // => [4, 1, 3, 2] */ function shuffle(collection) { - collection = toIterable(collection); - - var index = -1, - length = collection.length, - result = Array(length); - - while (++index < length) { - var rand = baseRandom(0, index); - if (index != rand) { - result[index] = result[rand]; - } - result[rand] = collection[index]; - } - return result; + return sample(collection, POSITIVE_INFINITY); } module.exports = shuffle; diff --git a/lodash.shuffle/package.json b/lodash.shuffle/package.json index 64d857021..6f1a21e55 100644 --- a/lodash.shuffle/package.json +++ b/lodash.shuffle/package.json @@ -1,6 +1,6 @@ { "name": "lodash.shuffle", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.shuffle` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,7 +17,6 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._baserandom": "^3.0.0", - "lodash._toiterable": "^3.0.0" + "lodash.sample": "^3.0.0" } } diff --git a/lodash.snakecase/LICENSE b/lodash.snakecase/LICENSE new file mode 100644 index 000000000..b054ca5a3 --- /dev/null +++ b/lodash.snakecase/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lodash.snakecase/LICENSE.txt b/lodash.snakecase/LICENSE.txt deleted file mode 100644 index 17764328c..000000000 --- a/lodash.snakecase/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lodash.snakecase/README.md b/lodash.snakecase/README.md index 725018111..dc2f673db 100644 --- a/lodash.snakecase/README.md +++ b/lodash.snakecase/README.md @@ -1,20 +1,18 @@ -# lodash.snakecase v3.0.1 +# lodash.snakecase v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.snakeCase` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.snakeCase` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.snakecase ``` -In Node.js/io.js: - +In Node.js: ```js var snakeCase = require('lodash.snakecase'); ``` -See the [documentation](https://lodash.com/docs#snakeCase) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.snakecase) for more details. +See the [documentation](https://lodash.com/docs#snakeCase) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.snakecase) for more details. diff --git a/lodash.snakecase/index.js b/lodash.snakecase/index.js index 9c92e44bd..64f6614d4 100644 --- a/lodash.snakecase/index.js +++ b/lodash.snakecase/index.js @@ -1,12 +1,50 @@ /** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var createCompounder = require('lodash._createcompounder'); +var deburr = require('lodash.deburr'), + words = require('lodash.words'); + +/** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initFromArray] Specify using the first element of `array` as the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduce(array, iteratee, accumulator, initFromArray) { + var index = -1, + length = array.length; + + if (initFromArray && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} + +/** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ +function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string)), callback, ''); + }; +} /** * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case). diff --git a/lodash.snakecase/package.json b/lodash.snakecase/package.json index e220d8642..d7a170b5b 100644 --- a/lodash.snakecase/package.json +++ b/lodash.snakecase/package.json @@ -1,22 +1,21 @@ { "name": "lodash.snakecase", - "version": "3.0.1", - "description": "The modern build of lodash’s `_.snakeCase` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.snakeCase` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, snakecase", "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", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._createcompounder": "^3.0.0" + "lodash.deburr": "^3.0.0", + "lodash.words": "^3.0.0" } } diff --git a/lodash.some/LICENSE.txt b/lodash.some/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.some/LICENSE.txt +++ b/lodash.some/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.some/README.md b/lodash.some/README.md index 5ed16c941..b2770d155 100644 --- a/lodash.some/README.md +++ b/lodash.some/README.md @@ -1,4 +1,4 @@ -# lodash.some v3.0.0 +# lodash.some v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.some` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var some = require('lodash.some'); ``` -See the [documentation](https://lodash.com/docs#some) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.some) for more details. +See the [documentation](https://lodash.com/docs#some) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.some) for more details. diff --git a/lodash.some/index.js b/lodash.some/index.js index bbde7acc4..5960ac469 100644 --- a/lodash.some/index.js +++ b/lodash.some/index.js @@ -1,18 +1,19 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseCallback = require('lodash._basecallback'), baseEach = require('lodash._baseeach'), + isIterateeCall = require('lodash._isiterateecall'), isArray = require('lodash.isarray'); /** * A specialized version of `_.some` for arrays without support for callback - * shorthands or `this` binding. + * shorthands and `this` binding. * * @private * @param {Array} array The array to iterate over. @@ -34,7 +35,7 @@ function arraySome(array, predicate) { /** * The base implementation of `_.some` without support for callback shorthands - * or `this` binding. + * and `this` binding. * * @private * @param {Array|Object|string} collection The collection to iterate over. @@ -56,7 +57,7 @@ function baseSome(collection, predicate) { * Checks if `predicate` returns truthy for **any** element of `collection`. * The function returns as soon as it finds a passing value and does not iterate * over the entire collection. The predicate is bound to `thisArg` and invoked - * with three arguments; (value, index|key, collection). + * with three arguments: (value, index|key, collection). * * If a property name is provided for `predicate` the created `_.property` * style callback returns the property value of the given element. @@ -103,6 +104,9 @@ function baseSome(collection, predicate) { */ function some(collection, predicate, thisArg) { var func = isArray(collection) ? arraySome : baseSome; + if (thisArg && isIterateeCall(collection, predicate, thisArg)) { + predicate = null; + } if (typeof predicate != 'function' || typeof thisArg != 'undefined') { predicate = baseCallback(predicate, thisArg, 3); } diff --git a/lodash.some/package.json b/lodash.some/package.json index 5b99dee44..a7b6f0c00 100644 --- a/lodash.some/package.json +++ b/lodash.some/package.json @@ -1,6 +1,6 @@ { "name": "lodash.some", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.some` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -19,6 +19,7 @@ "dependencies": { "lodash._basecallback": "^3.0.0", "lodash._baseeach": "^3.0.0", + "lodash._isiterateecall": "^3.0.0", "lodash.isarray": "^3.0.0" } } diff --git a/lodash.sortby/README.md b/lodash.sortby/README.md index b9ca323cb..a53d09642 100644 --- a/lodash.sortby/README.md +++ b/lodash.sortby/README.md @@ -1,4 +1,4 @@ -# lodash.sortby v3.0.0 +# lodash.sortby v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.sortBy` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var sortBy = require('lodash.sortby'); ``` -See the [documentation](https://lodash.com/docs#sortBy) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.sortby) for more details. +See the [documentation](https://lodash.com/docs#sortBy) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.sortby) for more details. diff --git a/lodash.sortby/index.js b/lodash.sortby/index.js index df486febd..351049b07 100644 --- a/lodash.sortby/index.js +++ b/lodash.sortby/index.js @@ -1,8 +1,8 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ @@ -10,7 +10,9 @@ var baseCallback = require('lodash._basecallback'), baseCompareAscending = require('lodash._basecompareascending'), baseEach = require('lodash._baseeach'), baseSortBy = require('lodash._basesortby'), - isIterateeCall = require('lodash._isiterateecall'); + isIterateeCall = require('lodash._isiterateecall'), + isArray = require('lodash.isarray'), + keys = require('lodash.keys'); /** * Used by `_.sortBy` to compare transformed elements of a collection and stable @@ -26,18 +28,15 @@ function compareAscending(object, other) { } /** - * Used as the maximum length of an array-like value. - * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) - * for more details. + * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) + * of an array-like value. */ var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; /** * Checks if `value` is a valid array-like length. * - * **Note:** This function is based on ES `ToLength`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) - * for more details. + * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). * * @private * @param {*} value The value to check. @@ -51,17 +50,17 @@ function isLength(value) { * Creates an array of elements, sorted in ascending order by the results of * running each element in a collection through `iteratee`. This method performs * a stable sort, that is, it preserves the original sort order of equal elements. - * The `iteratee` is bound to `thisArg` and invoked with three arguments; + * The `iteratee` is bound to `thisArg` and invoked with three arguments: * (value, index|key, collection). * - * If a property name is provided for `predicate` the created `_.property` + * If a property name is provided for `iteratee` the created `_.property` * style callback returns the property value of the given element. * * If a value is also provided for `thisArg` the created `_.matchesProperty` * style callback returns `true` for elements that have a matching property * value, else `false`. * - * If an object is provided for `predicate` the created `_.matches` style + * If an object is provided for `iteratee` the created `_.matches` style * callback returns `true` for elements that have the properties of the given * object, else `false`. * @@ -97,8 +96,11 @@ function isLength(value) { * // => ['barney', 'fred', 'pebbles'] */ function sortBy(collection, iteratee, thisArg) { + if (collection == null) { + return []; + } var index = -1, - length = collection ? collection.length : 0, + length = collection.length, result = isLength(length) ? Array(length) : []; if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { diff --git a/lodash.sortby/package.json b/lodash.sortby/package.json index 3552b394e..082794ffe 100644 --- a/lodash.sortby/package.json +++ b/lodash.sortby/package.json @@ -1,6 +1,6 @@ { "name": "lodash.sortby", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.sortBy` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -21,6 +21,8 @@ "lodash._basecompareascending": "^3.0.0", "lodash._baseeach": "^3.0.0", "lodash._basesortby": "^3.0.0", - "lodash._isiterateecall": "^3.0.0" + "lodash._isiterateecall": "^3.0.0", + "lodash.isarray": "^3.0.0", + "lodash.keys": "^3.0.0" } } diff --git a/lodash.sortbyall/README.md b/lodash.sortbyall/README.md index f1ac42ba7..5ed99c62a 100644 --- a/lodash.sortbyall/README.md +++ b/lodash.sortbyall/README.md @@ -1,4 +1,4 @@ -# lodash.sortbyall v3.0.1 +# lodash.sortbyall v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.sortByAll` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var sortByAll = require('lodash.sortbyall'); ``` -See the [documentation](https://lodash.com/docs#sortByAll) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.sortbyall) for more details. +See the [documentation](https://lodash.com/docs#sortByAll) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.sortbyall) for more details. diff --git a/lodash.sortbyall/index.js b/lodash.sortbyall/index.js index 6456fcb0f..74f59fbb8 100644 --- a/lodash.sortbyall/index.js +++ b/lodash.sortbyall/index.js @@ -1,69 +1,17 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseCompareAscending = require('lodash._basecompareascending'), - baseEach = require('lodash._baseeach'), +var baseEach = require('lodash._baseeach'), baseFlatten = require('lodash._baseflatten'), - baseSortBy = require('lodash._basesortby'), - isIterateeCall = require('lodash._isiterateecall'); - -/** - * Used by `_.sortByAll` to compare multiple properties of each element - * in a collection and stable sort them in ascending order. - * - * @private - * @param {Object} object The object to compare to `other`. - * @param {Object} other The object to compare to `object`. - * @returns {number} Returns the sort order indicator for `object`. - */ -function compareMultipleAscending(object, other) { - var index = -1, - objCriteria = object.criteria, - othCriteria = other.criteria, - length = objCriteria.length; - - while (++index < length) { - var result = baseCompareAscending(objCriteria[index], othCriteria[index]); - if (result) { - return result; - } - } - // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications - // that causes it, under certain circumstances, to provide the same value for - // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 - // for more details. - // - // This also ensures a stable sort in V8 and other engines. - // See https://code.google.com/p/v8/issues/detail?id=90 for more details. - return object.index - other.index; -} - -/** - * Used as the maximum length of an array-like value. - * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) - * for more details. - */ -var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on ES `ToLength`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) - * for more details. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} + baseSortByOrder = require('lodash._basesortbyorder'), + isIterateeCall = require('lodash._isiterateecall'), + isArguments = require('lodash.isarguments'), + isArray = require('lodash.isarray'); /** * This method is like `_.sortBy` except that it sorts by property names @@ -89,25 +37,16 @@ function isLength(value) { * // => [['barney', 26], ['barney', 36], ['fred', 30], ['fred', 40]] */ function sortByAll(collection) { - var args = arguments; - if (args.length > 3 && isIterateeCall(args[1], args[2], args[3])) { + if (collection == null) { + return []; + } + var args = arguments, + guard = args[3]; + + if (guard && isIterateeCall(args[1], args[2], guard)) { args = [collection, args[1]]; } - var index = -1, - length = collection ? collection.length : 0, - props = baseFlatten(args, false, false, 1), - result = isLength(length) ? Array(length) : []; - - baseEach(collection, function(value) { - var length = props.length, - criteria = Array(length); - - while (length--) { - criteria[length] = value == null ? undefined : value[props[length]]; - } - result[++index] = { 'criteria': criteria, 'index': index, 'value': value }; - }); - return baseSortBy(result, compareMultipleAscending); + return baseSortByOrder(collection, baseFlatten(args, false, false, 1), []); } module.exports = sortByAll; diff --git a/lodash.sortbyall/package.json b/lodash.sortbyall/package.json index 2688b0828..ce3d678f9 100644 --- a/lodash.sortbyall/package.json +++ b/lodash.sortbyall/package.json @@ -1,6 +1,6 @@ { "name": "lodash.sortbyall", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s `_.sortByAll` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,10 +17,11 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._basecompareascending": "^3.0.0", "lodash._baseeach": "^3.0.0", "lodash._baseflatten": "^3.0.0", - "lodash._basesortby": "^3.0.0", - "lodash._isiterateecall": "^3.0.0" + "lodash._basesortbyorder": "^3.0.0", + "lodash._isiterateecall": "^3.0.0", + "lodash.isarguments": "^3.0.0", + "lodash.isarray": "^3.0.0" } } diff --git a/lodash.sortedindex/README.md b/lodash.sortedindex/README.md index 1cb24a66d..b3dd87767 100644 --- a/lodash.sortedindex/README.md +++ b/lodash.sortedindex/README.md @@ -1,4 +1,4 @@ -# lodash.sortedindex v3.0.1 +# lodash.sortedindex v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.sortedIndex` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var sortedIndex = require('lodash.sortedindex'); ``` -See the [documentation](https://lodash.com/docs#sortedIndex) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.sortedindex) for more details. +See the [documentation](https://lodash.com/docs#sortedIndex) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.sortedindex) for more details. diff --git a/lodash.sortedindex/index.js b/lodash.sortedindex/index.js index 402b5ac55..c819a90b5 100644 --- a/lodash.sortedindex/index.js +++ b/lodash.sortedindex/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.2 @@ -8,7 +8,8 @@ */ var baseCallback = require('lodash._basecallback'), binaryIndex = require('lodash._binaryindex'), - binaryIndexBy = require('lodash._binaryindexby'); + binaryIndexBy = require('lodash._binaryindexby'), + isArray = require('lodash.isarray'); /** * Creates a `_.sortedIndex` or `_.sortedLastIndex` function. diff --git a/lodash.sortedindex/package.json b/lodash.sortedindex/package.json index 5eab95535..315972e7f 100644 --- a/lodash.sortedindex/package.json +++ b/lodash.sortedindex/package.json @@ -1,6 +1,6 @@ { "name": "lodash.sortedindex", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s `_.sortedIndex` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -19,6 +19,7 @@ "dependencies": { "lodash._basecallback": "^3.0.0", "lodash._binaryindex": "^3.0.0", - "lodash._binaryindexby": "^3.0.0" + "lodash._binaryindexby": "^3.0.0", + "lodash.isarray": "^3.0.0" } } diff --git a/lodash.sortedlastindex/README.md b/lodash.sortedlastindex/README.md index 076118cfa..727206580 100644 --- a/lodash.sortedlastindex/README.md +++ b/lodash.sortedlastindex/README.md @@ -1,4 +1,4 @@ -# lodash.sortedlastindex v3.0.1 +# lodash.sortedlastindex v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.sortedLastIndex` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var sortedLastIndex = require('lodash.sortedlastindex'); ``` -See the [documentation](https://lodash.com/docs#sortedLastIndex) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.sortedlastindex) for more details. +See the [documentation](https://lodash.com/docs#sortedLastIndex) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.sortedlastindex) for more details. diff --git a/lodash.sortedlastindex/index.js b/lodash.sortedlastindex/index.js index 0e942fa6b..6cdaaa2cc 100644 --- a/lodash.sortedlastindex/index.js +++ b/lodash.sortedlastindex/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.2 @@ -8,7 +8,8 @@ */ var baseCallback = require('lodash._basecallback'), binaryIndex = require('lodash._binaryindex'), - binaryIndexBy = require('lodash._binaryindexby'); + binaryIndexBy = require('lodash._binaryindexby'), + isArray = require('lodash.isarray'); /** * Creates a `_.sortedIndex` or `_.sortedLastIndex` function. diff --git a/lodash.sortedlastindex/package.json b/lodash.sortedlastindex/package.json index 0defedd07..cb03709d3 100644 --- a/lodash.sortedlastindex/package.json +++ b/lodash.sortedlastindex/package.json @@ -1,6 +1,6 @@ { "name": "lodash.sortedlastindex", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s `_.sortedLastIndex` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -19,6 +19,7 @@ "dependencies": { "lodash._basecallback": "^3.0.0", "lodash._binaryindex": "^3.0.0", - "lodash._binaryindexby": "^3.0.0" + "lodash._binaryindexby": "^3.0.0", + "lodash.isarray": "^3.0.0" } } diff --git a/lodash.kebabcase/LICENSE.txt b/lodash.startcase/LICENSE.txt similarity index 100% rename from lodash.kebabcase/LICENSE.txt rename to lodash.startcase/LICENSE.txt diff --git a/lodash.startcase/README.md b/lodash.startcase/README.md new file mode 100644 index 000000000..08d5412ec --- /dev/null +++ b/lodash.startcase/README.md @@ -0,0 +1,20 @@ +# lodash.startcase v3.1.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.startCase` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.startcase +``` + +In Node.js/io.js: + +```js +var startCase = require('lodash.startcase'); +``` + +See the [documentation](https://lodash.com/docs#startCase) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.startcase) for more details. diff --git a/lodash.startcase/index.js b/lodash.startcase/index.js new file mode 100644 index 000000000..343d91888 --- /dev/null +++ b/lodash.startcase/index.js @@ -0,0 +1,34 @@ +/** + * lodash 3.1.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.7.0 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var createCompounder = require('lodash._createcompounder'); + +/** + * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__foo_bar__'); + * // => 'Foo Bar' + */ +var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1)); +}); + +module.exports = startCase; diff --git a/lodash.startcase/package.json b/lodash.startcase/package.json new file mode 100644 index 000000000..5b222b623 --- /dev/null +++ b/lodash.startcase/package.json @@ -0,0 +1,22 @@ +{ + "name": "lodash.startcase", + "version": "3.1.0", + "description": "The modern build of lodash’s `_.startCase` 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/)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, + "dependencies": { + "lodash._createcompounder": "^3.0.0" + } +} diff --git a/lodash.startswith/LICENSE b/lodash.startswith/LICENSE new file mode 100644 index 000000000..b054ca5a3 --- /dev/null +++ b/lodash.startswith/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lodash.startswith/README.md b/lodash.startswith/README.md index ca80be278..bc19ab49b 100644 --- a/lodash.startswith/README.md +++ b/lodash.startswith/README.md @@ -1,20 +1,18 @@ -# lodash.startswith v3.0.1 +# lodash.startswith v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.startsWith` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.startsWith` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.startswith ``` -In Node.js/io.js: - +In Node.js: ```js var startsWith = require('lodash.startswith'); ``` -See the [documentation](https://lodash.com/docs#startsWith) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.startswith) for more details. +See the [documentation](https://lodash.com/docs#startsWith) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.startswith) for more details. diff --git a/lodash.startswith/index.js b/lodash.startswith/index.js index 8af538977..63f6ecbba 100644 --- a/lodash.startswith/index.js +++ b/lodash.startswith/index.js @@ -1,15 +1,284 @@ /** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.2 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseToString = require('lodash._basetostring'); -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + symbolTag = '[object Symbol]'; + +/** 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 `global`. */ +var freeParseInt = parseInt; + +/** Used for built-in method references. */ +var objectProto = global.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 value references. */ +var _Symbol = global.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = _Symbol ? _Symbol.prototype : undefined, + symbolToString = _Symbol ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.clamp` which doesn't coerce arguments to numbers. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ +function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; +} + +/** + * 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 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) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * 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 _ + * @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 _ + * @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); +} + +/** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ +function toInteger(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + var remainder = value % 1; + return value === value ? (remainder ? value - remainder : value) : 0; +} + +/** + * 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); +} + +/** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return _Symbol ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} /** * Checks if `string` starts with the given target string. @@ -33,11 +302,8 @@ var nativeMin = Math.min; * // => true */ function startsWith(string, target, position) { - string = baseToString(string); - position = position == null - ? 0 - : nativeMin(position < 0 ? 0 : (+position || 0), string.length); - + string = toString(string); + position = baseClamp(toInteger(position), 0, string.length); return string.lastIndexOf(target, position) == position; } diff --git a/lodash.startswith/package.json b/lodash.startswith/package.json index d4db00a6a..9277bcb82 100644 --- a/lodash.startswith/package.json +++ b/lodash.startswith/package.json @@ -1,22 +1,17 @@ { "name": "lodash.startswith", - "version": "3.0.1", - "description": "The modern build of lodash’s `_.startsWith` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.startsWith` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, startswith", "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", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "dependencies": { - "lodash._basetostring": "^3.0.0" - } + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } } diff --git a/lodash.takerightwhile/README.md b/lodash.takerightwhile/README.md index 69195d24a..d9adb33f4 100644 --- a/lodash.takerightwhile/README.md +++ b/lodash.takerightwhile/README.md @@ -1,4 +1,4 @@ -# lodash.takerightwhile v3.0.1 +# lodash.takerightwhile v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.takeRightWhile` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var takeRightWhile = require('lodash.takerightwhile'); ``` -See the [documentation](https://lodash.com/docs#takeRightWhile) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.takerightwhile) for more details. +See the [documentation](https://lodash.com/docs#takeRightWhile) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.takerightwhile) for more details. diff --git a/lodash.takerightwhile/index.js b/lodash.takerightwhile/index.js index 0e15953ca..d9b8a8337 100644 --- a/lodash.takerightwhile/index.js +++ b/lodash.takerightwhile/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.2 @@ -7,7 +7,8 @@ * Available under MIT license */ var baseCallback = require('lodash._basecallback'), - baseSlice = require('lodash._baseslice'); + baseSlice = require('lodash._baseslice'), + isArray = require('lodash.isarray'); /** * The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`, diff --git a/lodash.takerightwhile/package.json b/lodash.takerightwhile/package.json index ee5953bf2..4b7d36d90 100644 --- a/lodash.takerightwhile/package.json +++ b/lodash.takerightwhile/package.json @@ -1,6 +1,6 @@ { "name": "lodash.takerightwhile", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s `_.takeRightWhile` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,6 +18,7 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._basecallback": "^3.0.0", - "lodash._baseslice": "^3.0.0" + "lodash._baseslice": "^3.0.0", + "lodash.isarray": "^3.0.0" } } diff --git a/lodash.takewhile/README.md b/lodash.takewhile/README.md index 5f5899b67..1827ccabd 100644 --- a/lodash.takewhile/README.md +++ b/lodash.takewhile/README.md @@ -1,4 +1,4 @@ -# lodash.takewhile v3.0.1 +# lodash.takewhile v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.takeWhile` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var takeWhile = require('lodash.takewhile'); ``` -See the [documentation](https://lodash.com/docs#takeWhile) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.takewhile) for more details. +See the [documentation](https://lodash.com/docs#takeWhile) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.takewhile) for more details. diff --git a/lodash.takewhile/index.js b/lodash.takewhile/index.js index cb2b7480a..d5891c633 100644 --- a/lodash.takewhile/index.js +++ b/lodash.takewhile/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.2 @@ -7,7 +7,8 @@ * Available under MIT license */ var baseCallback = require('lodash._basecallback'), - baseSlice = require('lodash._baseslice'); + baseSlice = require('lodash._baseslice'), + isArray = require('lodash.isarray'); /** * The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`, diff --git a/lodash.takewhile/package.json b/lodash.takewhile/package.json index 1eb3ec3a8..0f1929e38 100644 --- a/lodash.takewhile/package.json +++ b/lodash.takewhile/package.json @@ -1,6 +1,6 @@ { "name": "lodash.takewhile", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s `_.takeWhile` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,6 +18,7 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._basecallback": "^3.0.0", - "lodash._baseslice": "^3.0.0" + "lodash._baseslice": "^3.0.0", + "lodash.isarray": "^3.0.0" } } diff --git a/lodash.templatesettings/README.md b/lodash.templatesettings/README.md index a07e60308..85ed09084 100644 --- a/lodash.templatesettings/README.md +++ b/lodash.templatesettings/README.md @@ -1,4 +1,4 @@ -# lodash.templatesettings v3.0.1 +# lodash.templatesettings v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.templateSettings` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var templateSettings = require('lodash.templatesettings'); ``` -See the [documentation](https://lodash.com/docs#templateSettings) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.templatesettings) for more details. +See the [documentation](https://lodash.com/docs#templateSettings) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.templatesettings) for more details. diff --git a/lodash.templatesettings/index.js b/lodash.templatesettings/index.js index 6cc49a6cd..21aad3867 100644 --- a/lodash.templatesettings/index.js +++ b/lodash.templatesettings/index.js @@ -1,16 +1,18 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.7.0 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var reEscape = require('lodash._reescape'), - reEvaluate = require('lodash._reevaluate'), - reInterpolate = require('lodash._reinterpolate'), +var reInterpolate = require('lodash._reinterpolate'), escape = require('lodash.escape'); +/** Used to match template delimiters. */ +var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g; + /** * By default, the template delimiters used by lodash are like those in * embedded Ruby (ERB). Change the following template settings to use diff --git a/lodash.templatesettings/package.json b/lodash.templatesettings/package.json index 1f737e8d2..7f91b3427 100644 --- a/lodash.templatesettings/package.json +++ b/lodash.templatesettings/package.json @@ -1,6 +1,6 @@ { "name": "lodash.templatesettings", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s `_.templateSettings` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,8 +17,6 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._reescape": "^3.0.0", - "lodash._reevaluate": "^3.0.0", "lodash._reinterpolate": "^3.0.0", "lodash.escape": "^3.0.0" } diff --git a/lodash.trim/LICENSE b/lodash.trim/LICENSE new file mode 100644 index 000000000..b054ca5a3 --- /dev/null +++ b/lodash.trim/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lodash.trim/LICENSE.txt b/lodash.trim/LICENSE.txt deleted file mode 100644 index 17764328c..000000000 --- a/lodash.trim/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lodash.trim/README.md b/lodash.trim/README.md index c9446fb5e..238789359 100644 --- a/lodash.trim/README.md +++ b/lodash.trim/README.md @@ -1,20 +1,18 @@ -# lodash.trim v3.0.1 +# lodash.trim v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.trim` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.trim` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.trim ``` -In Node.js/io.js: - +In Node.js: ```js var trim = require('lodash.trim'); ``` -See the [documentation](https://lodash.com/docs#trim) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.trim) for more details. +See the [documentation](https://lodash.com/docs#trim) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.trim) for more details. diff --git a/lodash.trim/index.js b/lodash.trim/index.js index e001a540d..d144988a0 100644 --- a/lodash.trim/index.js +++ b/lodash.trim/index.js @@ -1,17 +1,156 @@ /** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseToString = require('lodash._basetostring'), - charsLeftIndex = require('lodash._charsleftindex'), - charsRightIndex = require('lodash._charsrightindex'), - isIterateeCall = require('lodash._isiterateecall'), - trimmedLeftIndex = require('lodash._trimmedleftindex'), - trimmedRightIndex = require('lodash._trimmedrightindex'); +var charsEndIndex = require('lodash._charsendindex'), + charsStartIndex = require('lodash._charsstartindex'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsModifier = '(?:\\ud83c[\\udffb-\\udfff])', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reComplexSymbol = RegExp(rsSymbol + rsSeq, 'g'); + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return string.match(reComplexSymbol); +} + +/** Used for built-in method references. */ +var objectProto = global.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 value references. */ +var _Symbol = global.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = _Symbol ? _Symbol.prototype : undefined, + symbolToString = _Symbol ? symbolProto.toString : undefined; + +/** + * 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 _ + * @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 _ + * @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); +} + +/** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return _Symbol ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} /** * Removes leading and trailing whitespace or specified characters from `string`. @@ -21,7 +160,7 @@ var baseToString = require('lodash._basetostring'), * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. * @returns {string} Returns the trimmed string. * @example * @@ -35,16 +174,21 @@ var baseToString = require('lodash._basetostring'), * // => ['foo', 'bar'] */ function trim(string, chars, guard) { - var value = string; - string = baseToString(string); + string = toString(string); if (!string) { return string; } - if (guard ? isIterateeCall(value, chars, guard) : chars == null) { - return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1); + if (guard || chars === undefined) { + return string.replace(reTrim, ''); } chars = (chars + ''); - return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1); + if (!chars) { + return string; + } + var strSymbols = stringToArray(string), + chrSymbols = stringToArray(chars); + + return strSymbols.slice(charsStartIndex(strSymbols, chrSymbols), charsEndIndex(strSymbols, chrSymbols) + 1).join(''); } module.exports = trim; diff --git a/lodash.trim/package.json b/lodash.trim/package.json index 2a41ee73c..cda140e29 100644 --- a/lodash.trim/package.json +++ b/lodash.trim/package.json @@ -1,27 +1,21 @@ { "name": "lodash.trim", - "version": "3.0.1", - "description": "The modern build of lodash’s `_.trim` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.trim` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, trim", "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", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._basetostring": "^3.0.0", - "lodash._charsleftindex": "^3.0.0", - "lodash._charsrightindex": "^3.0.0", - "lodash._isiterateecall": "^3.0.0", - "lodash._trimmedleftindex": "^3.0.0", - "lodash._trimmedrightindex": "^3.0.0" + "lodash._charsendindex": "^3.0.0", + "lodash._charsstartindex": "^3.0.0" } } diff --git a/lodash.unescape/LICENSE b/lodash.unescape/LICENSE new file mode 100644 index 000000000..b054ca5a3 --- /dev/null +++ b/lodash.unescape/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lodash.unescape/LICENSE.txt b/lodash.unescape/LICENSE.txt deleted file mode 100644 index 17764328c..000000000 --- a/lodash.unescape/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lodash.unescape/README.md b/lodash.unescape/README.md index 3453e305a..5d1e1da83 100644 --- a/lodash.unescape/README.md +++ b/lodash.unescape/README.md @@ -1,20 +1,18 @@ -# lodash.unescape v3.0.0 +# lodash.unescape v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.unescape` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.unescape` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.unescape ``` -In Node.js/io.js: - +In Node.js: ```js var unescape = require('lodash.unescape'); ``` -See the [documentation](https://lodash.com/docs#unescape) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.unescape) for more details. +See the [documentation](https://lodash.com/docs#unescape) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.unescape) for more details. diff --git a/lodash.unescape/index.js b/lodash.unescape/index.js index ac4e392c4..4d976b195 100644 --- a/lodash.unescape/index.js +++ b/lodash.unescape/index.js @@ -1,12 +1,17 @@ /** - * lodash 3.0.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseToString = require('lodash._basetostring'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; /** Used to match HTML entities and HTML characters. */ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, @@ -33,6 +38,105 @@ function unescapeHtmlChar(chr) { return htmlUnescapes[chr]; } +/** Used for built-in method references. */ +var objectProto = global.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 value references. */ +var _Symbol = global.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = _Symbol ? _Symbol.prototype : undefined, + symbolToString = _Symbol ? symbolProto.toString : undefined; + +/** + * 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 _ + * @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 _ + * @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); +} + +/** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return _Symbol ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + /** * The inverse of `_.escape`; this method converts the HTML entities * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their @@ -52,7 +156,7 @@ function unescapeHtmlChar(chr) { * // => 'fred, barney, & pebbles' */ function unescape(string) { - string = baseToString(string); + string = toString(string); return (string && reHasEscapedHtml.test(string)) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string; diff --git a/lodash.unescape/package.json b/lodash.unescape/package.json index f77f771fd..e694480a8 100644 --- a/lodash.unescape/package.json +++ b/lodash.unescape/package.json @@ -1,22 +1,17 @@ { "name": "lodash.unescape", - "version": "3.0.0", - "description": "The modern build of lodash’s `_.unescape` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.unescape` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, unescape", "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", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "dependencies": { - "lodash._basetostring": "^3.0.0" - } + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } } diff --git a/lodash.union/LICENSE.txt b/lodash.union/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.union/LICENSE.txt +++ b/lodash.union/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.union/README.md b/lodash.union/README.md index 25e8ff485..62f67e410 100644 --- a/lodash.union/README.md +++ b/lodash.union/README.md @@ -1,4 +1,4 @@ -# lodash.union v3.0.1 +# lodash.union v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.union` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var union = require('lodash.union'); ``` -See the [documentation](https://lodash.com/docs#union) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.union) for more details. +See the [documentation](https://lodash.com/docs#union) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.union) for more details. diff --git a/lodash.union/index.js b/lodash.union/index.js index b8c0d48e5..aca07fe41 100644 --- a/lodash.union/index.js +++ b/lodash.union/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.2 @@ -7,16 +7,13 @@ * Available under MIT license */ var baseFlatten = require('lodash._baseflatten'), - baseUniq = require('lodash._baseuniq'); + baseUniq = require('lodash._baseuniq'), + restParam = require('lodash.restparam'); /** - * Creates an array of unique values, in order, of the provided arrays using - * `SameValueZero` for equality comparisons. - * - * **Note:** `SameValueZero` comparisons are like strict equality comparisons, - * e.g. `===`, except that `NaN` matches `NaN`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for more details. + * Creates an array of unique values, in order, from all of the provided arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. * * @static * @memberOf _ @@ -28,8 +25,8 @@ var baseFlatten = require('lodash._baseflatten'), * _.union([1, 2], [4, 2], [2, 1]); * // => [1, 2, 4] */ -function union() { - return baseUniq(baseFlatten(arguments, false, true, 0)); -} +var union = restParam(function(arrays) { + return baseUniq(baseFlatten(arrays, false, true)); +}); module.exports = union; diff --git a/lodash.union/package.json b/lodash.union/package.json index 4c7870065..11f419264 100644 --- a/lodash.union/package.json +++ b/lodash.union/package.json @@ -1,6 +1,6 @@ { "name": "lodash.union", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s `_.union` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,6 +18,7 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._baseflatten": "^3.0.0", - "lodash._baseuniq": "^3.0.0" + "lodash._baseuniq": "^3.0.0", + "lodash.restparam": "^3.0.0" } } diff --git a/lodash.uniq/LICENSE.txt b/lodash.uniq/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.uniq/LICENSE.txt +++ b/lodash.uniq/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.uniq/README.md b/lodash.uniq/README.md index 3e55344a9..17ec3147a 100644 --- a/lodash.uniq/README.md +++ b/lodash.uniq/README.md @@ -1,4 +1,4 @@ -# lodash.uniq v3.0.1 +# lodash.uniq v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.uniq` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var uniq = require('lodash.uniq'); ``` -See the [documentation](https://lodash.com/docs#uniq) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.uniq) for more details. +See the [documentation](https://lodash.com/docs#uniq) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.uniq) for more details. diff --git a/lodash.uniq/index.js b/lodash.uniq/index.js index 9c4a3bf16..94e453e21 100644 --- a/lodash.uniq/index.js +++ b/lodash.uniq/index.js @@ -1,14 +1,16 @@ /** - * lodash 3.0.1 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseCallback = require('lodash._basecallback'), baseUniq = require('lodash._baseuniq'), - isIterateeCall = require('lodash._isiterateecall'); + isIterateeCall = require('lodash._isiterateecall'), + isArray = require('lodash.isarray'), + isNative = require('lodash.isnative'); /** * An implementation of `_.uniq` optimized for sorted arrays without support @@ -39,12 +41,14 @@ function sortedUniq(array, iteratee) { } /** - * Creates a duplicate-value-free version of an array using `SameValueZero` - * for equality comparisons. Providing `true` for `isSorted` performs a faster - * search algorithm for sorted arrays. If an iteratee function is provided it - * is invoked for each value in the array to generate the criterion by which - * uniqueness is computed. The `iteratee` is bound to `thisArg` and invoked - * with three arguments: (value, index, array). + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) + * for equality comparisons, in which only the first occurence of each element + * is kept. Providing `true` for `isSorted` performs a faster search algorithm + * for sorted arrays. If an iteratee function is provided it is invoked for + * each element in the array to generate the criterion by which uniqueness + * is computed. The `iteratee` is bound to `thisArg` and invoked with three + * arguments: (value, index, array). * * If a property name is provided for `iteratee` the created `_.property` * style callback returns the property value of the given element. @@ -57,10 +61,6 @@ function sortedUniq(array, iteratee) { * callback returns `true` for elements that have the properties of the given * object, else `false`. * - * **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * comparisons are like strict equality comparisons, e.g. `===`, except that - * `NaN` matches `NaN`. - * * @static * @memberOf _ * @alias unique @@ -72,8 +72,8 @@ function sortedUniq(array, iteratee) { * @returns {Array} Returns the new duplicate-value-free array. * @example * - * _.uniq([1, 2, 1]); - * // => [1, 2] + * _.uniq([2, 1, 2]); + * // => [2, 1] * * // using `isSorted` * _.uniq([1, 1, 2], true); diff --git a/lodash.uniq/package.json b/lodash.uniq/package.json index f5bd6eb67..e81f4a8db 100644 --- a/lodash.uniq/package.json +++ b/lodash.uniq/package.json @@ -1,6 +1,6 @@ { "name": "lodash.uniq", - "version": "3.0.1", + "version": "3.1.0", "description": "The modern build of lodash’s `_.uniq` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -19,6 +19,8 @@ "dependencies": { "lodash._basecallback": "^3.0.0", "lodash._baseuniq": "^3.0.0", - "lodash._isiterateecall": "^3.0.0" + "lodash._isiterateecall": "^3.0.0", + "lodash.isarray": "^3.0.0", + "lodash.isnative": "^3.0.0" } } diff --git a/lodash.uniqueid/LICENSE b/lodash.uniqueid/LICENSE new file mode 100644 index 000000000..b054ca5a3 --- /dev/null +++ b/lodash.uniqueid/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lodash.uniqueid/LICENSE.txt b/lodash.uniqueid/LICENSE.txt deleted file mode 100644 index 17764328c..000000000 --- a/lodash.uniqueid/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lodash.uniqueid/README.md b/lodash.uniqueid/README.md index 88d44e58c..12abfb1e2 100644 --- a/lodash.uniqueid/README.md +++ b/lodash.uniqueid/README.md @@ -1,20 +1,18 @@ -# lodash.uniqueid v3.0.0 +# lodash.uniqueid v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.uniqueId` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.uniqueId` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.uniqueid ``` -In Node.js/io.js: - +In Node.js: ```js var uniqueId = require('lodash.uniqueid'); ``` -See the [documentation](https://lodash.com/docs#uniqueId) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.uniqueid) for more details. +See the [documentation](https://lodash.com/docs#uniqueId) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.uniqueid) for more details. diff --git a/lodash.uniqueid/index.js b/lodash.uniqueid/index.js index 878ad9949..4a4fc5840 100644 --- a/lodash.uniqueid/index.js +++ b/lodash.uniqueid/index.js @@ -1,22 +1,126 @@ /** - * lodash 3.0.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseToString = require('lodash._basetostring'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used for built-in method references. */ +var objectProto = global.Object.prototype; /** Used to generate unique IDs. */ var idCounter = 0; +/** + * 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 value references. */ +var _Symbol = global.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = _Symbol ? _Symbol.prototype : undefined, + symbolToString = _Symbol ? symbolProto.toString : undefined; + +/** + * 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 _ + * @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 _ + * @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); +} + +/** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return _Symbol ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + /** * Generates a unique ID. If `prefix` is provided the ID is appended to it. * * @static * @memberOf _ - * @category Utility + * @category Util * @param {string} [prefix] The value to prefix the ID with. * @returns {string} Returns the unique ID. * @example @@ -29,7 +133,7 @@ var idCounter = 0; */ function uniqueId(prefix) { var id = ++idCounter; - return baseToString(prefix) + id; + return toString(prefix) + id; } module.exports = uniqueId; diff --git a/lodash.uniqueid/package.json b/lodash.uniqueid/package.json index 60fb822e9..a5bacd171 100644 --- a/lodash.uniqueid/package.json +++ b/lodash.uniqueid/package.json @@ -1,22 +1,17 @@ { "name": "lodash.uniqueid", - "version": "3.0.0", - "description": "The modern build of lodash’s `_.uniqueId` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.uniqueId` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, uniqueid", "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", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "dependencies": { - "lodash._basetostring": "^3.0.0" - } + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } } diff --git a/lodash.unzip/LICENSE.txt b/lodash.unzip/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.unzip/LICENSE.txt +++ b/lodash.unzip/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.unzip/README.md b/lodash.unzip/README.md index 099e8c3bd..ee3a51e1f 100644 --- a/lodash.unzip/README.md +++ b/lodash.unzip/README.md @@ -1,4 +1,4 @@ -# lodash.unzip v3.0.0 +# lodash.unzip v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.unzip` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var unzip = require('lodash.unzip'); ``` -See the [documentation](https://lodash.com/docs#unzip) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.unzip) for more details. +See the [documentation](https://lodash.com/docs#unzip) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.unzip) for more details. diff --git a/lodash.unzip/index.js b/lodash.unzip/index.js index 51147ddb5..5387c1bd0 100644 --- a/lodash.unzip/index.js +++ b/lodash.unzip/index.js @@ -1,16 +1,37 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var arrayMap = require('lodash._arraymap'), - arrayMax = require('lodash._arraymax'), - baseProperty = require('lodash._baseproperty'); + arrayMax = require('lodash._arraymax'); -/** Used to the length of n-tuples for `_.unzip`. */ +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * in Safari on iOS 8.1 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ var getLength = baseProperty('length'); /** diff --git a/lodash.unzip/package.json b/lodash.unzip/package.json index ee04ea4e2..f1a64c961 100644 --- a/lodash.unzip/package.json +++ b/lodash.unzip/package.json @@ -1,6 +1,6 @@ { "name": "lodash.unzip", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.unzip` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,7 +18,6 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._arraymap": "^3.0.0", - "lodash._arraymax": "^3.0.0", - "lodash._baseproperty": "^3.0.0" + "lodash._arraymax": "^3.0.0" } } diff --git a/lodash.where/README.md b/lodash.where/README.md index f37dcc23d..cc77e3769 100644 --- a/lodash.where/README.md +++ b/lodash.where/README.md @@ -1,4 +1,4 @@ -# lodash.where v3.0.0 +# lodash.where v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.where` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var where = require('lodash.where'); ``` -See the [documentation](https://lodash.com/docs#where) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.where) for more details. +See the [documentation](https://lodash.com/docs#where) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.where) for more details. diff --git a/lodash.where/index.js b/lodash.where/index.js index 04020f4c5..b5a526c38 100644 --- a/lodash.where/index.js +++ b/lodash.where/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.7.0 @@ -8,127 +8,23 @@ */ var arrayFilter = require('lodash._arrayfilter'), baseCallback = require('lodash._basecallback'), - baseClone = require('lodash._baseclone'), baseFilter = require('lodash._basefilter'), - baseIsEqual = require('lodash._baseisequal'), - isArray = require('lodash.isarray'), - keys = require('lodash.keys'); - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * The base implementation of `_.isMatch` without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Object} source The object to inspect. - * @param {Array} props The source property names to match. - * @param {Array} values The source values to match. - * @param {Array} strictCompareFlags Strict comparison flags for source values. - * @param {Function} [customizer] The function to customize comparing objects. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ -function baseIsMatch(object, props, values, strictCompareFlags, customizer) { - var length = props.length; - if (object == null) { - return !length; - } - var index = -1, - noCustomizer = !customizer; - - while (++index < length) { - if ((noCustomizer && strictCompareFlags[index]) - ? values[index] !== object[props[index]] - : !hasOwnProperty.call(object, props[index]) - ) { - return false; - } - } - index = -1; - while (++index < length) { - var key = props[index]; - if (noCustomizer && strictCompareFlags[index]) { - var result = hasOwnProperty.call(object, key); - } else { - var objValue = object[key], - srcValue = values[index]; - - result = customizer ? customizer(objValue, srcValue, key) : undefined; - if (typeof result == 'undefined') { - result = baseIsEqual(srcValue, objValue, customizer, true); - } - } - if (!result) { - return false; - } - } - return true; -} - -/** - * The base implementation of `_.matches` which supports specifying whether - * `source` should be cloned. - * - * @private - * @param {Object} source The object of property values to match. - * @param {boolean} [isCloned] Specify cloning the source object. - * @returns {Function} Returns the new function. - */ -function baseMatches(source, isCloned) { - var props = keys(source), - length = props.length; - - if (length == 1) { - var key = props[0], - value = source[key]; - - if (isStrictComparable(value)) { - return function(object) { - return object != null && value === object[key] && hasOwnProperty.call(object, key); - }; - } - } - if (isCloned) { - source = baseClone(source, true); - } - var values = Array(length), - strictCompareFlags = Array(length); - - while (length--) { - value = source[props[length]]; - values[length] = value; - strictCompareFlags[length] = isStrictComparable(value); - } - return function(object) { - return baseIsMatch(object, props, values, strictCompareFlags); - }; -} - -/** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ -function isStrictComparable(value) { - return value === value && (value === 0 ? ((1 / value) > 0) : !isObject(value)); -} + baseMatches = require('lodash._basematches'), + isArray = require('lodash.isarray'); /** * Iterates over elements of `collection`, returning an array of all elements * `predicate` returns truthy for. The predicate is bound to `thisArg` and - * invoked with three arguments; (value, index|key, collection). + * invoked with three arguments: (value, index|key, collection). * - * If a property name is provided for `predicate` the created "_.property" + * If a property name is provided for `predicate` the created `_.property` * style callback returns the property value of the given element. * - * If an object is provided for `predicate` the created "_.matches" style + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style * callback returns `true` for elements that have the properties of the given * object, else `false`. * @@ -138,26 +34,31 @@ function isStrictComparable(value) { * @category Collection * @param {Array|Object|string} collection The collection to iterate over. * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. If a property name or object is provided it is used to - * create a "_.property" or "_.matches" style callback respectively. + * per iteration. * @param {*} [thisArg] The `this` binding of `predicate`. * @returns {Array} Returns the new filtered array. * @example * - * var evens = _.filter([1, 2, 3, 4], function(n) { return n % 2 == 0; }); - * // => [2, 4] + * _.filter([4, 5, 6], function(n) { + * return n % 2 == 0; + * }); + * // => [4, 6] * * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } * ]; * - * // using the "_.property" callback shorthand - * _.pluck(_.filter(users, 'active'), 'user'); + * // using the `_.matches` callback shorthand + * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user'); + * // => ['barney'] + * + * // using the `_.matchesProperty` callback shorthand + * _.pluck(_.filter(users, 'active', false), 'user'); * // => ['fred'] * - * // using the "_.matches" callback shorthand - * _.pluck(_.filter(users, { 'age': 36 }), 'user'); + * // using the `_.property` callback shorthand + * _.pluck(_.filter(users, 'active'), 'user'); * // => ['barney'] */ function filter(collection, predicate, thisArg) { @@ -171,6 +72,11 @@ function filter(collection, predicate, thisArg) { * source object, returning an array of all elements that have equivalent * property values. * + * **Note:** This method supports comparing arrays, booleans, `Date` objects, + * numbers, `Object` objects, regexes, and strings. Objects are compared by + * their own, not inherited, enumerable properties. For comparing a single + * own or inherited property value see `_.matchesProperty`. + * * @static * @memberOf _ * @category Collection @@ -180,79 +86,18 @@ function filter(collection, predicate, thisArg) { * @example * * var users = [ - * { 'user': 'barney', 'age': 36, 'status': 'busy', 'pets': ['hoppy'] }, - * { 'user': 'fred', 'age': 40, 'status': 'busy', 'pets': ['baby puss', 'dino'] } + * { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] }, + * { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] } * ]; * - * _.pluck(_.where(users, { 'age': 36 }), 'user'); + * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user'); * // => ['barney'] * * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user'); * // => ['fred'] - * - * _.pluck(_.where(users, { 'status': 'busy' }), 'user'); - * // => ['barney', 'fred'] */ function where(collection, source) { - return filter(collection, matches(source)); -} - -/** - * Checks if `value` is the language type of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * **Note:** See the [ES5 spec](https://es5.github.io/#x8) for more details. - * - * @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(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return type == 'function' || (value && type == 'object') || false; -} - -/** - * Creates a function which performs a deep comparison between a given object - * and `source`, returning `true` if the given object has equivalent property - * values, else `false`. - * - * @static - * @memberOf _ - * @category Utility - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * var matchesAge = _.matches({ 'age': 36 }); - * - * _.filter(users, matchesAge); - * // => [{ 'user': 'barney', 'age': 36 }] - * - * _.find(users, matchesAge); - * // => { 'user': 'barney', 'age': 36 } - */ -function matches(source) { - return baseMatches(source, true); + return filter(collection, baseMatches(source)); } module.exports = where; diff --git a/lodash.where/package.json b/lodash.where/package.json index a38e63c31..62cafc186 100644 --- a/lodash.where/package.json +++ b/lodash.where/package.json @@ -1,6 +1,6 @@ { "name": "lodash.where", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.where` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -19,10 +19,8 @@ "dependencies": { "lodash._arrayfilter": "^3.0.0", "lodash._basecallback": "^3.0.0", - "lodash._baseclone": "^3.0.0", "lodash._basefilter": "^3.0.0", - "lodash._baseisequal": "^3.0.0", - "lodash.isarray": "^3.0.0", - "lodash.keys": "^3.0.0" + "lodash._basematches": "^3.0.0", + "lodash.isarray": "^3.0.0" } } diff --git a/lodash.without/LICENSE.txt b/lodash.without/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.without/LICENSE.txt +++ b/lodash.without/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.without/README.md b/lodash.without/README.md index 12d4cbf77..938209292 100644 --- a/lodash.without/README.md +++ b/lodash.without/README.md @@ -1,4 +1,4 @@ -# lodash.without v3.0.0 +# lodash.without v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.without` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var without = require('lodash.without'); ``` -See the [documentation](https://lodash.com/docs#without) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.without) for more details. +See the [documentation](https://lodash.com/docs#without) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.without) for more details. diff --git a/lodash.without/index.js b/lodash.without/index.js index 2e0bf0f85..11ad7e925 100644 --- a/lodash.without/index.js +++ b/lodash.without/index.js @@ -1,22 +1,23 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseDifference = require('lodash._basedifference'), - baseSlice = require('lodash._baseslice'); + isArguments = require('lodash.isarguments'), + isArray = require('lodash.isarray'), + restParam = require('lodash.restparam'); /** * Creates an array excluding all provided values using `SameValueZero` for * equality comparisons. * - * **Note:** `SameValueZero` comparisons are like strict equality comparisons, - * e.g. `===`, except that `NaN` matches `NaN`. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for more details. + * **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) + * comparisons are like strict equality comparisons, e.g. `===`, except that + * `NaN` matches `NaN`. * * @static * @memberOf _ @@ -29,8 +30,10 @@ var baseDifference = require('lodash._basedifference'), * _.without([1, 2, 1, 3], 1, 2); * // => [3] */ -function without(array) { - return baseDifference(array, baseSlice(arguments, 1)); -} +var without = restParam(function(array, values) { + return (isArray(array) || isArguments(array)) + ? baseDifference(array, values) + : []; +}); module.exports = without; diff --git a/lodash.without/package.json b/lodash.without/package.json index 394817cbb..0f50ae52d 100644 --- a/lodash.without/package.json +++ b/lodash.without/package.json @@ -1,6 +1,6 @@ { "name": "lodash.without", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.without` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,6 +18,8 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._basedifference": "^3.0.0", - "lodash._baseslice": "^3.0.0" + "lodash.isarguments": "^3.0.0", + "lodash.isarray": "^3.0.0", + "lodash.restparam": "^3.0.0" } } diff --git a/lodash.words/LICENSE b/lodash.words/LICENSE index 9cd87e5dc..b054ca5a3 100644 --- a/lodash.words/LICENSE +++ b/lodash.words/LICENSE @@ -1,5 +1,5 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.words/README.md b/lodash.words/README.md index 9b79fa13d..9c9ff9f71 100644 --- a/lodash.words/README.md +++ b/lodash.words/README.md @@ -1,20 +1,18 @@ -# lodash.words v3.0.2 +# lodash.words v3.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.words` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.words` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.words ``` -In Node.js/io.js: - +In Node.js: ```js var words = require('lodash.words'); ``` -See the [documentation](https://lodash.com/docs#words) or [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash.words) for more details. +See the [documentation](https://lodash.com/docs#words) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.words) for more details. diff --git a/lodash.words/index.js b/lodash.words/index.js index e593dc6f7..372f26136 100644 --- a/lodash.words/index.js +++ b/lodash.words/index.js @@ -1,21 +1,165 @@ /** - * lodash 3.0.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation + * lodash 3.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseToString = require('lodash._basetostring'), - isIterateeCall = require('lodash._isiterateecall'); -/** Used to match words to create compound words. */ -var reWords = (function() { - var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]', - lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+'; +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; - return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g'); -}()); +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsQuoteRange = '\\u2018\\u2019\\u201c\\u201d', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsQuoteRange + rsSpaceRange; + +/** Used to compose unicode capture groups. */ +var rsBreak = '[' + rsBreakRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsModifier = '(?:\\ud83c[\\udffb-\\udfff])', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')', + rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq; + +/** Used to match non-compound words composed of alphanumeric characters. */ +var reBasicWord = /[a-zA-Z0-9]+/g; + +/** Used to match complex or compound words. */ +var reComplexWord = RegExp([ + rsUpper + '?' + rsLower + '+(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsUpperMisc + '+(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', + rsUpper + '?' + rsLowerMisc + '+', + rsDigits + '(?:' + rsLowerMisc + '+)?', + rsEmoji +].join('|'), 'g'); + +/** Used to detect strings that need a more robust regexp to match words. */ +var reHasComplexWord = /[a-z][A-Z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + +/** Used for built-in method references. */ +var objectProto = global.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 value references. */ +var _Symbol = global.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = _Symbol ? _Symbol.prototype : undefined, + symbolToString = _Symbol ? symbolProto.toString : undefined; + +/** + * 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 _ + * @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 _ + * @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); +} + +/** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return _Symbol ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} /** * Splits `string` into an array of its words. @@ -25,7 +169,7 @@ var reWords = (function() { * @category String * @param {string} [string=''] The string to inspect. * @param {RegExp|string} [pattern] The pattern to match words. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. * @returns {Array} Returns the words of `string`. * @example * @@ -36,11 +180,13 @@ var reWords = (function() { * // => ['fred', 'barney', '&', 'pebbles'] */ function words(string, pattern, guard) { - if (guard && isIterateeCall(string, pattern, guard)) { - pattern = undefined; + string = toString(string); + pattern = guard ? undefined : pattern; + + if (pattern === undefined) { + pattern = reHasComplexWord.test(string) ? reComplexWord : reBasicWord; } - string = baseToString(string); - return string.match(pattern || reWords) || []; + return string.match(pattern) || []; } module.exports = words; diff --git a/lodash.words/package.json b/lodash.words/package.json index ccceda164..c4d356dee 100644 --- a/lodash.words/package.json +++ b/lodash.words/package.json @@ -1,23 +1,17 @@ { "name": "lodash.words", - "version": "3.0.2", - "description": "The modern build of lodash’s `_.words` as a module.", + "version": "3.1.0", + "description": "The lodash method `_.words` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", - "keywords": "lodash, lodash-modularized, stdlib, util", + "keywords": "lodash, lodash-modularized, stdlib, util, words", "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", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "dependencies": { - "lodash._basetostring": "^3.0.0", - "lodash._isiterateecall": "^3.0.0" - } + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } } diff --git a/lodash.xor/LICENSE.txt b/lodash.xor/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.xor/LICENSE.txt +++ b/lodash.xor/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.xor/README.md b/lodash.xor/README.md index ccd94b604..83d583e91 100644 --- a/lodash.xor/README.md +++ b/lodash.xor/README.md @@ -1,4 +1,4 @@ -# lodash.xor v3.0.0 +# lodash.xor v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.xor` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var xor = require('lodash.xor'); ``` -See the [documentation](https://lodash.com/docs#xor) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.xor) for more details. +See the [documentation](https://lodash.com/docs#xor) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.xor) for more details. diff --git a/lodash.xor/index.js b/lodash.xor/index.js index 94d693cc1..04eda23ee 100644 --- a/lodash.xor/index.js +++ b/lodash.xor/index.js @@ -1,15 +1,68 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseDifference = require('lodash._basedifference'), - baseUniq = require('lodash._baseuniq'), - isArguments = require('lodash.isarguments'), - isArray = require('lodash.isarray'); + baseUniq = require('lodash._baseuniq'); + +/** + * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) + * of an array-like value. + */ +var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +/** + * Checks if `value` is array-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + */ +function isArrayLike(value) { + return value != null && isLength(getLength(value)); +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} /** * Creates an array that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) @@ -31,7 +84,7 @@ function xor() { while (++index < length) { var array = arguments[index]; - if (isArray(array) || isArguments(array)) { + if (isArrayLike(array)) { var result = result ? baseDifference(result, array).concat(baseDifference(array, result)) : array; diff --git a/lodash.xor/package.json b/lodash.xor/package.json index 073ebaf5a..8689cd49e 100644 --- a/lodash.xor/package.json +++ b/lodash.xor/package.json @@ -1,6 +1,6 @@ { "name": "lodash.xor", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.xor` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -18,8 +18,6 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { "lodash._basedifference": "^3.0.0", - "lodash._baseuniq": "^3.0.0", - "lodash.isarguments": "^3.0.0", - "lodash.isarray": "^3.0.0" + "lodash._baseuniq": "^3.0.0" } } diff --git a/lodash.zip/LICENSE.txt b/lodash.zip/LICENSE.txt index 17764328c..9cd87e5dc 100644 --- a/lodash.zip/LICENSE.txt +++ b/lodash.zip/LICENSE.txt @@ -1,5 +1,5 @@ Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining diff --git a/lodash.zip/README.md b/lodash.zip/README.md index 84d8c41eb..bd6c5a93a 100644 --- a/lodash.zip/README.md +++ b/lodash.zip/README.md @@ -1,4 +1,4 @@ -# lodash.zip v3.0.0 +# lodash.zip v3.1.0 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.zip` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var zip = require('lodash.zip'); ``` -See the [documentation](https://lodash.com/docs#zip) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.zip) for more details. +See the [documentation](https://lodash.com/docs#zip) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.zip) for more details. diff --git a/lodash.zip/index.js b/lodash.zip/index.js index c2b18f8ee..d951c6438 100644 --- a/lodash.zip/index.js +++ b/lodash.zip/index.js @@ -1,12 +1,13 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.1.0 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.2 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var unzip = require('lodash.unzip'); +var restParam = require('lodash.restparam'), + unzip = require('lodash.unzip'); /** * Creates an array of grouped elements, the first of which contains the first @@ -23,14 +24,6 @@ var unzip = require('lodash.unzip'); * _.zip(['fred', 'barney'], [30, 40], [true, false]); * // => [['fred', 30, true], ['barney', 40, false]] */ -function zip() { - var length = arguments.length, - array = Array(length); - - while (length--) { - array[length] = arguments[length]; - } - return unzip(array); -} +var zip = restParam(unzip); module.exports = zip; diff --git a/lodash.zip/package.json b/lodash.zip/package.json index 225b905fc..284a8f5c9 100644 --- a/lodash.zip/package.json +++ b/lodash.zip/package.json @@ -1,6 +1,6 @@ { "name": "lodash.zip", - "version": "3.0.0", + "version": "3.1.0", "description": "The modern build of lodash’s `_.zip` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -17,6 +17,7 @@ "repository": "lodash/lodash", "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { + "lodash.restparam": "^3.0.0", "lodash.unzip": "^3.0.0" } }