From 5bd01fbdbc4bd88a1a49b60c041cd17cd534a9f1 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 12 Apr 2016 23:44:05 -0700 Subject: [PATCH] Bump to v4.0.8. --- README.md | 2 +- lodash.assign/README.md | 4 +-- lodash.assign/index.js | 18 ++-------- lodash.assign/package.json | 2 +- lodash.assignin/README.md | 4 +-- lodash.assignin/index.js | 18 ++-------- lodash.assignin/package.json | 2 +- lodash.debounce/README.md | 4 +-- lodash.debounce/index.js | 50 +++++++++------------------ lodash.debounce/package.json | 2 +- lodash.keys/README.md | 4 +-- lodash.keys/index.js | 67 ++++++++++++++++++++---------------- lodash.keys/package.json | 2 +- 13 files changed, 70 insertions(+), 109 deletions(-) diff --git a/README.md b/README.md index 97ed28213..b8b20b8ee 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# lodash v4.0.7 +# lodash v4.0.8 The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method. diff --git a/lodash.assign/README.md b/lodash.assign/README.md index 3f74d38bd..4328741ae 100644 --- a/lodash.assign/README.md +++ b/lodash.assign/README.md @@ -1,4 +1,4 @@ -# lodash.assign v4.0.7 +# lodash.assign v4.0.8 The [lodash](https://lodash.com/) method `_.assign` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var assign = require('lodash.assign'); ``` -See the [documentation](https://lodash.com/docs#assign) or [package source](https://github.com/lodash/lodash/blob/4.0.7-npm-packages/lodash.assign) for more details. +See the [documentation](https://lodash.com/docs#assign) or [package source](https://github.com/lodash/lodash/blob/4.0.8-npm-packages/lodash.assign) for more details. diff --git a/lodash.assign/index.js b/lodash.assign/index.js index 7e0bd111c..20eae3f55 100644 --- a/lodash.assign/index.js +++ b/lodash.assign/index.js @@ -1,5 +1,5 @@ /** - * lodash 4.0.7 (Custom Build) + * lodash 4.0.8 (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license @@ -90,24 +90,10 @@ function baseProperty(key) { * @param {Object} source The object to copy properties from. * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. - * @returns {Object} Returns `object`. - */ -function copyObject(source, props, object) { - return copyObjectWith(source, props, object); -} - -/** - * This function is like `copyObject` except that it accepts a function to - * customize copied values. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ -function copyObjectWith(source, props, object, customizer) { +function copyObject(source, props, object, customizer) { object || (object = {}); var index = -1, diff --git a/lodash.assign/package.json b/lodash.assign/package.json index 7d67b87d0..3c02f35a7 100644 --- a/lodash.assign/package.json +++ b/lodash.assign/package.json @@ -1,6 +1,6 @@ { "name": "lodash.assign", - "version": "4.0.7", + "version": "4.0.8", "description": "The lodash method `_.assign` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", diff --git a/lodash.assignin/README.md b/lodash.assignin/README.md index 1ab5c1936..5b5bf7709 100644 --- a/lodash.assignin/README.md +++ b/lodash.assignin/README.md @@ -1,4 +1,4 @@ -# lodash.assignin v4.0.7 +# lodash.assignin v4.0.8 The [lodash](https://lodash.com/) method `_.assignIn` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var assignIn = require('lodash.assignin'); ``` -See the [documentation](https://lodash.com/docs#assignIn) or [package source](https://github.com/lodash/lodash/blob/4.0.7-npm-packages/lodash.assignin) for more details. +See the [documentation](https://lodash.com/docs#assignIn) or [package source](https://github.com/lodash/lodash/blob/4.0.8-npm-packages/lodash.assignin) for more details. diff --git a/lodash.assignin/index.js b/lodash.assignin/index.js index 1956e1bac..9185f1fcf 100644 --- a/lodash.assignin/index.js +++ b/lodash.assignin/index.js @@ -1,5 +1,5 @@ /** - * lodash 4.0.7 (Custom Build) + * lodash 4.0.8 (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license @@ -90,24 +90,10 @@ function baseProperty(key) { * @param {Object} source The object to copy properties from. * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. - * @returns {Object} Returns `object`. - */ -function copyObject(source, props, object) { - return copyObjectWith(source, props, object); -} - -/** - * This function is like `copyObject` except that it accepts a function to - * customize copied values. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ -function copyObjectWith(source, props, object, customizer) { +function copyObject(source, props, object, customizer) { object || (object = {}); var index = -1, diff --git a/lodash.assignin/package.json b/lodash.assignin/package.json index a012d2217..2323a27cb 100644 --- a/lodash.assignin/package.json +++ b/lodash.assignin/package.json @@ -1,6 +1,6 @@ { "name": "lodash.assignin", - "version": "4.0.7", + "version": "4.0.8", "description": "The lodash method `_.assignIn` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", diff --git a/lodash.debounce/README.md b/lodash.debounce/README.md index c8ad30f5a..52e638c74 100644 --- a/lodash.debounce/README.md +++ b/lodash.debounce/README.md @@ -1,4 +1,4 @@ -# lodash.debounce v4.0.7 +# lodash.debounce v4.0.8 The [lodash](https://lodash.com/) method `_.debounce` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var debounce = require('lodash.debounce'); ``` -See the [documentation](https://lodash.com/docs#debounce) or [package source](https://github.com/lodash/lodash/blob/4.0.7-npm-packages/lodash.debounce) for more details. +See the [documentation](https://lodash.com/docs#debounce) or [package source](https://github.com/lodash/lodash/blob/4.0.8-npm-packages/lodash.debounce) for more details. diff --git a/lodash.debounce/index.js b/lodash.debounce/index.js index 84c7e49ec..ac5707d72 100644 --- a/lodash.debounce/index.js +++ b/lodash.debounce/index.js @@ -14,9 +14,7 @@ var FUNC_ERROR_TEXT = 'Expected a function'; var NAN = 0 / 0; /** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - symbolTag = '[object Symbol]'; +var symbolTag = '[object Symbol]'; /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g; @@ -33,12 +31,21 @@ var reIsOctal = /^0o[0-7]+$/i; /** Built-in method references without a dependency on `root`. */ var freeParseInt = parseInt; +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -63,9 +70,9 @@ var nativeMax = Math.max, * }, _.now()); * // => Logs the number of milliseconds it took for the deferred invocation. */ -function now() { - return Date.now(); -} +var now = function() { + return root.Date.now(); +}; /** * Creates a debounced function that delays invoking `func` until after `wait` @@ -243,34 +250,9 @@ function debounce(func, wait, options) { return debounced; } -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - /** * Checks if `value` is the - * [language type](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 @@ -379,7 +361,7 @@ function toNumber(value) { return NAN; } if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject(other) ? (other + '') : other; } if (typeof value != 'string') { diff --git a/lodash.debounce/package.json b/lodash.debounce/package.json index 244e3b296..2974633cf 100644 --- a/lodash.debounce/package.json +++ b/lodash.debounce/package.json @@ -1,6 +1,6 @@ { "name": "lodash.debounce", - "version": "4.0.7", + "version": "4.0.8", "description": "The lodash method `_.debounce` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", diff --git a/lodash.keys/README.md b/lodash.keys/README.md index 5c9c49c62..d03a60909 100644 --- a/lodash.keys/README.md +++ b/lodash.keys/README.md @@ -1,4 +1,4 @@ -# lodash.keys v4.0.7 +# lodash.keys v4.0.8 The [lodash](https://lodash.com/) method `_.keys` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var keys = require('lodash.keys'); ``` -See the [documentation](https://lodash.com/docs#keys) or [package source](https://github.com/lodash/lodash/blob/4.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/4.0.8-npm-packages/lodash.keys) for more details. diff --git a/lodash.keys/index.js b/lodash.keys/index.js index 39530dfc6..1753fb57e 100644 --- a/lodash.keys/index.js +++ b/lodash.keys/index.js @@ -19,6 +19,19 @@ var argsTag = '[object Arguments]', /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; +/** + * 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]; + }; +} + /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. @@ -38,6 +51,20 @@ function baseTimes(n, iteratee) { return result; } +/** + * Creates a function that invokes `func` with its first argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -62,7 +89,7 @@ var nativeGetPrototype = Object.getPrototypeOf, * The base implementation of `_.has` without support for deep paths. * * @private - * @param {Object} object The object to query. + * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ @@ -70,8 +97,9 @@ function baseHas(object, key) { // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, // that are composed entirely of index properties, return `false` for // `hasOwnProperty` checks of them. - return hasOwnProperty.call(object, key) || - (typeof object == 'object' && key in object && getPrototype(object) === null); + return object != null && + (hasOwnProperty.call(object, key) || + (typeof object == 'object' && key in object && getPrototype(object) === null)); } /** @@ -82,22 +110,7 @@ function baseHas(object, key) { * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ -function baseKeys(object) { - return nativeKeys(Object(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 accessor function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} +var baseKeys = overArg(nativeKeys, Object); /** * Gets the "length" property value of `object`. @@ -119,9 +132,7 @@ var getLength = baseProperty('length'); * @param {*} value The value to query. * @returns {null|Object} Returns the `[[Prototype]]`. */ -function getPrototype(value) { - return nativeGetPrototype(Object(value)); -} +var getPrototype = overArg(nativeGetPrototype, Object); /** * Creates an array of index keys for `object` values of arrays, @@ -177,7 +188,7 @@ function isPrototype(value) { * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, + * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * @@ -199,11 +210,9 @@ function isArguments(value) { * @static * @memberOf _ * @since 0.1.0 - * @type {Function} * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); @@ -286,8 +295,7 @@ function isArrayLikeObject(value) { * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); @@ -402,8 +410,7 @@ function isObjectLike(value) { * @memberOf _ * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * * _.isString('abc'); diff --git a/lodash.keys/package.json b/lodash.keys/package.json index f095c5720..88054a351 100644 --- a/lodash.keys/package.json +++ b/lodash.keys/package.json @@ -1,6 +1,6 @@ { "name": "lodash.keys", - "version": "4.0.7", + "version": "4.0.8", "description": "The lodash method `_.keys` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg",