Bump to v4.2.4.

This commit is contained in:
John-David Dalton
2016-04-02 20:21:35 -07:00
parent de03050e76
commit efac96034f
8 changed files with 153 additions and 78 deletions

View File

@@ -1,4 +1,4 @@
# lodash.toarray v4.2.3
# lodash.toarray v4.2.4
The [lodash](https://lodash.com/) method `_.toArray` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var toArray = require('lodash.toarray');
```
See the [documentation](https://lodash.com/docs#toArray) or [package source](https://github.com/lodash/lodash/blob/4.2.3-npm-packages/lodash.toarray) for more details.
See the [documentation](https://lodash.com/docs#toArray) or [package source](https://github.com/lodash/lodash/blob/4.2.4-npm-packages/lodash.toarray) for more details.

View File

@@ -1,5 +1,5 @@
/**
* lodash 4.2.3 (Custom Build) <https://lodash.com/>
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
@@ -24,7 +24,10 @@ var funcTag = '[object Function]',
var dataViewTag = '[object DataView]';
/** 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 detect host constructors (Safari). */
@@ -129,11 +132,11 @@ function iteratorToArray(iterator) {
}
/**
* Converts `map` to an array.
* Converts `map` to its key-value pairs.
*
* @private
* @param {Object} map The map to convert.
* @returns {Array} Returns the converted array.
* @returns {Array} Returns the key-value pairs.
*/
function mapToArray(map) {
var index = -1,
@@ -146,11 +149,11 @@ function mapToArray(map) {
}
/**
* Converts `set` to an array.
* Converts `set` to an array of its values.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the converted array.
* @returns {Array} Returns the values.
*/
function setToArray(set) {
var index = -1,
@@ -183,7 +186,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;
@@ -206,18 +210,18 @@ var DataView = getNative(root, 'DataView'),
WeakMap = getNative(root, 'WeakMap');
/** 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);
/**
* 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.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
@@ -290,8 +294,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) {
@@ -306,6 +310,25 @@ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
};
}
/**
* 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 '';
}
/**
* Checks if `value` is classified as an `Array` object.
*
@@ -421,8 +444,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 _
@@ -496,14 +520,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));
}
/**

View File

@@ -1,6 +1,6 @@
{
"name": "lodash.toarray",
"version": "4.2.3",
"version": "4.2.4",
"description": "The lodash method `_.toArray` exported as a module.",
"homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg",