From 826825a40adecad4fd9b0425dd4b8a09da257466 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 7 Apr 2016 23:56:26 -0700 Subject: [PATCH] Bump to v4.5.5. --- README.md | 2 +- lodash._baseclone/README.md | 4 +-- lodash._baseclone/index.js | 59 +++++++++++++++++++++++----------- lodash._baseclone/package.json | 2 +- 4 files changed, 44 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 96456499d..868dee17c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# lodash v4.5.4 +# lodash v4.5.5 The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method. diff --git a/lodash._baseclone/README.md b/lodash._baseclone/README.md index a9ef3fbb2..7a370728e 100644 --- a/lodash._baseclone/README.md +++ b/lodash._baseclone/README.md @@ -1,4 +1,4 @@ -# lodash._baseclone v4.5.4 +# lodash._baseclone v4.5.5 The internal [lodash](https://lodash.com/) function `baseClone` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var baseClone = require('lodash._baseclone'); ``` -See the [package source](https://github.com/lodash/lodash/blob/4.5.4-npm-packages/lodash._baseclone) for more details. +See the [package source](https://github.com/lodash/lodash/blob/4.5.5-npm-packages/lodash._baseclone) for more details. diff --git a/lodash._baseclone/index.js b/lodash._baseclone/index.js index f93673f61..70ef5561e 100644 --- a/lodash._baseclone/index.js +++ b/lodash._baseclone/index.js @@ -1,5 +1,5 @@ /** - * lodash 4.5.4 (Custom Build) + * lodash 4.5.5 (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license @@ -46,7 +46,10 @@ var arrayBufferTag = '[object ArrayBuffer]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; -/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; /** Used to match `RegExp` flags from their coerced string values. */ @@ -317,7 +320,8 @@ var funcToString = Function.prototype.toString; var hasOwnProperty = objectProto.hasOwnProperty; /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -350,18 +354,18 @@ var DataView = getNative(root, 'DataView'), nativeCreate = getNative(Object, 'create'); /** Used to detect maps, sets, and weakmaps. */ -var dataViewCtorString = DataView ? (DataView + '') : '', - mapCtorString = Map ? funcToString.call(Map) : '', - promiseCtorString = Promise ? funcToString.call(Promise) : '', - setCtorString = Set ? funcToString.call(Set) : '', - weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : ''; +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; /** - * Creates an hash object. + * Creates a hash object. * * @private * @constructor @@ -1178,8 +1182,8 @@ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : null, - ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : ''; + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; if (ctorString) { switch (ctorString) { @@ -1319,6 +1323,25 @@ function isPrototype(value) { return value === proto; } +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -1544,8 +1567,9 @@ function isLength(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('')`) + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ @@ -1619,14 +1643,11 @@ function isObjectLike(value) { * // => false */ function isNative(value) { - if (value == null) { + if (!isObject(value)) { return false; } - if (isFunction(value)) { - return reIsNative.test(funcToString.call(value)); - } - return isObjectLike(value) && - (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); } /** diff --git a/lodash._baseclone/package.json b/lodash._baseclone/package.json index aa8818570..776ba9e4f 100644 --- a/lodash._baseclone/package.json +++ b/lodash._baseclone/package.json @@ -1,6 +1,6 @@ { "name": "lodash._baseclone", - "version": "4.5.4", + "version": "4.5.5", "description": "The internal lodash function `baseClone` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg",