Compare commits

...

2 Commits

Author SHA1 Message Date
John-David Dalton
8bff780a94 Bump to v4.3.0. 2016-02-08 00:50:21 -08:00
John-David Dalton
f18e5950b9 Bump to v4.2.1. 2016-02-03 00:54:36 -08:00
46 changed files with 362 additions and 82 deletions

33
LICENSE
View File

@@ -1,22 +1,23 @@
The MIT License (MIT)
Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining a copy
a copy of this software and associated documentation files (the of this software and associated documentation files (the "Software"), to deal
"Software"), to deal in the Software without restriction, including in the Software without restriction, including without limitation the rights
without limitation the rights to use, copy, modify, merge, publish, to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
distribute, sublicense, and/or sell copies of the Software, and to copies of the Software, and to permit persons to whom the Software is
permit persons to whom the Software is furnished to do so, subject to furnished to do so, subject to the following conditions:
the following conditions:
The above copyright notice and this permission notice shall be The above copyright notice and this permission notice shall be included in all
included in all copies or substantial portions of the Software. copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. SOFTWARE.

View File

@@ -1,4 +1,4 @@
# lodash-es v4.2.0 # lodash-es v4.3.0
The [lodash](https://lodash.com/) library exported as [ES](http://www.ecma-international.org/ecma-262/6.0/) modules. The [lodash](https://lodash.com/) library exported as [ES](http://www.ecma-international.org/ecma-262/6.0/) modules.
@@ -7,4 +7,4 @@ Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli):
$ lodash modularize exports=es -o ./ $ lodash modularize exports=es -o ./
``` ```
See the [package source](https://github.com/lodash/lodash/tree/4.2.0-es) for more details. See the [package source](https://github.com/lodash/lodash/tree/4.3.0-es) for more details.

View File

@@ -3,6 +3,7 @@ import arrayEach from './_arrayEach';
import assignValue from './_assignValue'; import assignValue from './_assignValue';
import baseAssign from './_baseAssign'; import baseAssign from './_baseAssign';
import baseForOwn from './_baseForOwn'; import baseForOwn from './_baseForOwn';
import cloneBuffer from './_cloneBuffer';
import copyArray from './_copyArray'; import copyArray from './_copyArray';
import copySymbols from './_copySymbols'; import copySymbols from './_copySymbols';
import getTag from './_getTag'; import getTag from './_getTag';
@@ -10,6 +11,7 @@ import initCloneArray from './_initCloneArray';
import initCloneByTag from './_initCloneByTag'; import initCloneByTag from './_initCloneByTag';
import initCloneObject from './_initCloneObject'; import initCloneObject from './_initCloneObject';
import isArray from './isArray'; import isArray from './isArray';
import isBuffer from './isBuffer';
import isHostObject from './_isHostObject'; import isHostObject from './_isHostObject';
import isObject from './isObject'; import isObject from './isObject';
@@ -91,6 +93,9 @@ function baseClone(value, isDeep, customizer, key, object, stack) {
var tag = getTag(value), var tag = getTag(value),
isFunc = tag == funcTag || tag == genTag; isFunc = tag == funcTag || tag == genTag;
if (isBuffer(value)) {
return cloneBuffer(value, isDeep);
}
if (tag == objectTag || tag == argsTag || (isFunc && !object)) { if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
if (isHostObject(value)) { if (isHostObject(value)) {
return object ? value : {}; return object ? value : {};

View File

@@ -8,7 +8,7 @@ var FUNC_ERROR_TEXT = 'Expected a function';
* @private * @private
* @param {Function} func The function to delay. * @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay invocation. * @param {number} wait The number of milliseconds to delay invocation.
* @param {Object} args The arguments provide to `func`. * @param {Object} args The arguments to provide to `func`.
* @returns {number} Returns the timer id. * @returns {number} Returns the timer id.
*/ */
function baseDelay(func, wait, args) { function baseDelay(func, wait, args) {

View File

@@ -3,7 +3,7 @@ import isFunction from './isFunction';
/** /**
* The base implementation of `_.functions` which creates an array of * The base implementation of `_.functions` which creates an array of
* `object` function property names filtered from those provided. * `object` function property names filtered from `props`.
* *
* @private * @private
* @param {Object} object The object to inspect. * @param {Object} object The object to inspect.

19
_cloneArrayBuffer.js Normal file
View File

@@ -0,0 +1,19 @@
import Uint8Array from './_Uint8Array';
/**
* Creates a clone of `arrayBuffer`.
*
* @private
* @param {ArrayBuffer} arrayBuffer The array buffer to clone.
* @returns {ArrayBuffer} Returns the cloned array buffer.
*/
function cloneArrayBuffer(arrayBuffer) {
var Ctor = arrayBuffer.constructor,
result = new Ctor(arrayBuffer.byteLength),
view = new Uint8Array(result);
view.set(new Uint8Array(arrayBuffer));
return result;
}
export default cloneArrayBuffer;

View File

@@ -1,18 +1,19 @@
import Uint8Array from './_Uint8Array';
/** /**
* Creates a clone of `buffer`. * Creates a clone of `buffer`.
* *
* @private * @private
* @param {ArrayBuffer} buffer The array buffer to clone. * @param {Buffer} buffer The buffer to clone.
* @returns {ArrayBuffer} Returns the cloned array buffer. * @param {boolean} [isDeep] Specify a deep clone.
* @returns {Buffer} Returns the cloned buffer.
*/ */
function cloneBuffer(buffer) { function cloneBuffer(buffer, isDeep) {
if (isDeep) {
return buffer.slice();
}
var Ctor = buffer.constructor, var Ctor = buffer.constructor,
result = new Ctor(buffer.byteLength), result = new Ctor(buffer.length);
view = new Uint8Array(result);
view.set(new Uint8Array(buffer)); buffer.copy(result);
return result; return result;
} }

View File

@@ -1,4 +1,4 @@
import cloneBuffer from './_cloneBuffer'; import cloneArrayBuffer from './_cloneArrayBuffer';
/** /**
* Creates a clone of `typedArray`. * Creates a clone of `typedArray`.
@@ -12,7 +12,7 @@ function cloneTypedArray(typedArray, isDeep) {
var buffer = typedArray.buffer, var buffer = typedArray.buffer,
Ctor = typedArray.constructor; Ctor = typedArray.constructor;
return new Ctor(isDeep ? cloneBuffer(buffer) : buffer, typedArray.byteOffset, typedArray.length); return new Ctor(isDeep ? cloneArrayBuffer(buffer) : buffer, typedArray.byteOffset, typedArray.length);
} }
export default cloneTypedArray; export default cloneTypedArray;

View File

@@ -1,10 +1,12 @@
import Map from './_Map'; import Map from './_Map';
import Set from './_Set'; import Set from './_Set';
import WeakMap from './_WeakMap';
/** `Object#toString` result references. */ /** `Object#toString` result references. */
var mapTag = '[object Map]', var mapTag = '[object Map]',
objectTag = '[object Object]', objectTag = '[object Object]',
setTag = '[object Set]'; setTag = '[object Set]',
weakMapTag = '[object WeakMap]';
/** Used for built-in method references. */ /** Used for built-in method references. */
var objectProto = Object.prototype; var objectProto = Object.prototype;
@@ -18,9 +20,10 @@ var funcToString = Function.prototype.toString;
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
/** Used to detect maps and sets. */ /** Used to detect maps, sets, and weakmaps. */
var mapCtorString = Map ? funcToString.call(Map) : '', var mapCtorString = Map ? funcToString.call(Map) : '',
setCtorString = Set ? funcToString.call(Set) : ''; setCtorString = Set ? funcToString.call(Set) : '',
weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : '';
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
@@ -33,19 +36,20 @@ function getTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
// Fallback for IE 11 providing `toStringTag` values for maps and sets. // Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps.
if ((Map && getTag(new Map) != mapTag) || (Set && getTag(new Set) != setTag)) { if ((Map && getTag(new Map) != mapTag) ||
(Set && getTag(new Set) != setTag) ||
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
getTag = function(value) { getTag = function(value) {
var result = objectToString.call(value), var result = objectToString.call(value),
Ctor = result == objectTag ? value.constructor : null, Ctor = result == objectTag ? value.constructor : null,
ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : ''; ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : '';
if (ctorString) { if (ctorString) {
if (ctorString == mapCtorString) { switch (ctorString) {
return mapTag; case mapCtorString: return mapTag;
} case setCtorString: return setTag;
if (ctorString == setCtorString) { case weakMapCtorString: return weakMapTag;
return setTag;
} }
} }
return result; return result;

View File

@@ -1,4 +1,4 @@
import cloneBuffer from './_cloneBuffer'; import cloneArrayBuffer from './_cloneArrayBuffer';
import cloneMap from './_cloneMap'; import cloneMap from './_cloneMap';
import cloneRegExp from './_cloneRegExp'; import cloneRegExp from './_cloneRegExp';
import cloneSet from './_cloneSet'; import cloneSet from './_cloneSet';
@@ -42,7 +42,7 @@ function initCloneByTag(object, tag, isDeep) {
var Ctor = object.constructor; var Ctor = object.constructor;
switch (tag) { switch (tag) {
case arrayBufferTag: case arrayBufferTag:
return cloneBuffer(object); return cloneArrayBuffer(object);
case boolTag: case boolTag:
case dateTag: case dateTag:

View File

@@ -4,7 +4,7 @@ import isIndex from './_isIndex';
import isObject from './isObject'; import isObject from './isObject';
/** /**
* Checks if the provided arguments are from an iteratee call. * Checks if the given arguments are from an iteratee call.
* *
* @private * @private
* @param {*} value The potential iteratee value argument. * @param {*} value The potential iteratee value argument.

3
add.js
View File

@@ -14,6 +14,9 @@
*/ */
function add(augend, addend) { function add(augend, addend) {
var result; var result;
if (augend === undefined && addend === undefined) {
return 0;
}
if (augend !== undefined) { if (augend !== undefined) {
result = augend; result = augend;
} }

View File

@@ -44,10 +44,15 @@ var BIND_FLAG = 1,
var bind = rest(function(func, thisArg, partials) { var bind = rest(function(func, thisArg, partials) {
var bitmask = BIND_FLAG; var bitmask = BIND_FLAG;
if (partials.length) { if (partials.length) {
var holders = replaceHolders(partials, bind.placeholder); var placeholder = bind.placeholder,
holders = replaceHolders(partials, placeholder);
bitmask |= PARTIAL_FLAG; bitmask |= PARTIAL_FLAG;
} }
return createWrapper(func, bitmask, thisArg, partials, holders); return createWrapper(func, bitmask, thisArg, partials, holders);
}); });
// Assign default placeholders.
bind.placeholder = {};
export default bind; export default bind;

View File

@@ -54,10 +54,15 @@ var BIND_FLAG = 1,
var bindKey = rest(function(object, key, partials) { var bindKey = rest(function(object, key, partials) {
var bitmask = BIND_FLAG | BIND_KEY_FLAG; var bitmask = BIND_FLAG | BIND_KEY_FLAG;
if (partials.length) { if (partials.length) {
var holders = replaceHolders(partials, bindKey.placeholder); var placeholder = bindKey.placeholder,
holders = replaceHolders(partials, placeholder);
bitmask |= PARTIAL_FLAG; bitmask |= PARTIAL_FLAG;
} }
return createWrapper(key, bitmask, object, partials, holders); return createWrapper(key, bitmask, object, partials, holders);
}); });
// Assign default placeholders.
bindKey.placeholder = {};
export default bindKey; export default bindKey;

View File

@@ -3,7 +3,7 @@ import baseCreate from './_baseCreate';
/** /**
* Creates an object that inherits from the `prototype` object. If a `properties` * Creates an object that inherits from the `prototype` object. If a `properties`
* object is provided its own enumerable properties are assigned to the created object. * object is given its own enumerable properties are assigned to the created object.
* *
* @static * @static
* @memberOf _ * @memberOf _

View File

@@ -50,4 +50,7 @@ function curry(func, arity, guard) {
return result; return result;
} }
// Assign default placeholders.
curry.placeholder = {};
export default curry; export default curry;

View File

@@ -47,4 +47,7 @@ function curryRight(func, arity, guard) {
return result; return result;
} }
// Assign default placeholders.
curryRight.placeholder = {};
export default curryRight; export default curryRight;

View File

@@ -19,7 +19,7 @@ var nativeMax = Math.max;
* to the debounced function return the result of the last `func` invocation. * to the debounced function return the result of the last `func` invocation.
* *
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked * **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 * on the trailing edge of the timeout only if the debounced function is
* invoked more than once during the `wait` timeout. * invoked more than once during the `wait` timeout.
* *
* See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
@@ -135,7 +135,7 @@ function debounce(func, wait, options) {
if (maxWait === false) { if (maxWait === false) {
var leadingCall = leading && !timeoutId; var leadingCall = leading && !timeoutId;
} else { } else {
if (!maxTimeoutId && !leading) { if (!lastCalled && !maxTimeoutId && !leading) {
lastCalled = stamp; lastCalled = stamp;
} }
var remaining = maxWait - (stamp - lastCalled), var remaining = maxWait - (stamp - lastCalled),

View File

@@ -5,7 +5,7 @@ import rest from './rest';
/** /**
* Creates an array of unique `array` values not included in the other * Creates an array of unique `array` values not included in the other
* provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * given arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons. * for equality comparisons.
* *
* @static * @static

View File

@@ -1,9 +1,9 @@
import createFlow from './_createFlow'; import createFlow from './_createFlow';
/** /**
* Creates a function that returns the result of invoking the provided * Creates a function that returns the result of invoking the given functions
* functions with the `this` binding of the created function, where each * with the `this` binding of the created function, where each successive
* successive invocation is supplied the return value of the previous. * invocation is supplied the return value of the previous.
* *
* @static * @static
* @memberOf _ * @memberOf _

View File

@@ -2,7 +2,7 @@ import createFlow from './_createFlow';
/** /**
* This method is like `_.flow` except that it creates a function that * This method is like `_.flow` except that it creates a function that
* invokes the provided functions from right to left. * invokes the given functions from right to left.
* *
* @static * @static
* @memberOf _ * @memberOf _

View File

@@ -1,5 +1,5 @@
/** /**
* This method returns the first argument provided to it. * This method returns the first argument given to it.
* *
* @static * @static
* @memberOf _ * @memberOf _

View File

@@ -4,8 +4,8 @@ import rest from './rest';
import toArrayLikeObject from './_toArrayLikeObject'; import toArrayLikeObject from './_toArrayLikeObject';
/** /**
* Creates an array of unique values that are included in all of the provided * Creates an array of unique values that are included in all given arrays
* arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons. * for equality comparisons.
* *
* @static * @static

35
isArrayBuffer.js Normal file
View File

@@ -0,0 +1,35 @@
import isObjectLike from './isObjectLike';
var arrayBufferTag = '[object ArrayBuffer]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/**
* Checks if `value` is classified as an `ArrayBuffer` object.
*
* @static
* @memberOf _
* @type Function
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isArrayBuffer(new ArrayBuffer(2));
* // => true
*
* _.isArrayBuffer(new Array(2));
* // => false
*/
function isArrayBuffer(value) {
return isObjectLike(value) && objectToString.call(value) == arrayBufferTag;
}
export default isArrayBuffer;

42
isBuffer.js Normal file
View File

@@ -0,0 +1,42 @@
import constant from './constant';
import root from './_root';
/** Used to determine if values are of the language type `Object`. */
var objectTypes = {
'function': true,
'object': true
};
/** Detect free variable `exports`. */
var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
/** Detect free variable `module`. */
var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined;
/**
* Checks if `value` is a buffer.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
* @example
*
* _.isBuffer(new Buffer(2));
* // => true
*
* _.isBuffer(new Uint8Array(2));
* // => false
*/
var isBuffer = !Buffer ? constant(false) : function(value) {
return value instanceof Buffer;
};
export default isBuffer;

27
isMap.js Normal file
View File

@@ -0,0 +1,27 @@
import getTag from './_getTag';
import isObjectLike from './isObjectLike';
/** `Object#toString` result references. */
var mapTag = '[object Map]';
/**
* Checks if `value` is classified as a `Map` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isMap(new Map);
* // => true
*
* _.isMap(new WeakMap);
* // => false
*/
function isMap(value) {
return isObjectLike(value) && getTag(value) == mapTag;
}
export default isMap;

27
isSet.js Normal file
View File

@@ -0,0 +1,27 @@
import getTag from './_getTag';
import isObjectLike from './isObjectLike';
/** `Object#toString` result references. */
var setTag = '[object Set]';
/**
* Checks if `value` is classified as a `Set` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isSet(new Set);
* // => true
*
* _.isSet(new WeakSet);
* // => false
*/
function isSet(value) {
return isObjectLike(value) && getTag(value) == setTag;
}
export default isSet;

27
isWeakMap.js Normal file
View File

@@ -0,0 +1,27 @@
import getTag from './_getTag';
import isObjectLike from './isObjectLike';
/** `Object#toString` result references. */
var weakMapTag = '[object WeakMap]';
/**
* Checks if `value` is classified as a `WeakMap` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isWeakMap(new WeakMap);
* // => true
*
* _.isWeakMap(new Map);
* // => false
*/
function isWeakMap(value) {
return isObjectLike(value) && getTag(value) == weakMapTag;
}
export default isWeakMap;

35
isWeakSet.js Normal file
View File

@@ -0,0 +1,35 @@
import isObjectLike from './isObjectLike';
/** `Object#toString` result references. */
var weakSetTag = '[object WeakSet]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/**
* Checks if `value` is classified as a `WeakSet` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isWeakSet(new WeakSet);
* // => true
*
* _.isWeakSet(new Set);
* // => false
*/
function isWeakSet(value) {
return isObjectLike(value) && objectToString.call(value) == weakSetTag;
}
export default isWeakSet;

View File

@@ -7,9 +7,11 @@ import gt from './gt';
import gte from './gte'; import gte from './gte';
import isArguments from './isArguments'; import isArguments from './isArguments';
import isArray from './isArray'; import isArray from './isArray';
import isArrayBuffer from './isArrayBuffer';
import isArrayLike from './isArrayLike'; import isArrayLike from './isArrayLike';
import isArrayLikeObject from './isArrayLikeObject'; import isArrayLikeObject from './isArrayLikeObject';
import isBoolean from './isBoolean'; import isBoolean from './isBoolean';
import isBuffer from './isBuffer';
import isDate from './isDate'; import isDate from './isDate';
import isElement from './isElement'; import isElement from './isElement';
import isEmpty from './isEmpty'; import isEmpty from './isEmpty';
@@ -20,6 +22,7 @@ import isFinite from './isFinite';
import isFunction from './isFunction'; import isFunction from './isFunction';
import isInteger from './isInteger'; import isInteger from './isInteger';
import isLength from './isLength'; import isLength from './isLength';
import isMap from './isMap';
import isMatch from './isMatch'; import isMatch from './isMatch';
import isMatchWith from './isMatchWith'; import isMatchWith from './isMatchWith';
import isNaN from './isNaN'; import isNaN from './isNaN';
@@ -32,10 +35,13 @@ import isObjectLike from './isObjectLike';
import isPlainObject from './isPlainObject'; import isPlainObject from './isPlainObject';
import isRegExp from './isRegExp'; import isRegExp from './isRegExp';
import isSafeInteger from './isSafeInteger'; import isSafeInteger from './isSafeInteger';
import isSet from './isSet';
import isString from './isString'; import isString from './isString';
import isSymbol from './isSymbol'; import isSymbol from './isSymbol';
import isTypedArray from './isTypedArray'; import isTypedArray from './isTypedArray';
import isUndefined from './isUndefined'; import isUndefined from './isUndefined';
import isWeakMap from './isWeakMap';
import isWeakSet from './isWeakSet';
import lt from './lt'; import lt from './lt';
import lte from './lte'; import lte from './lte';
import toArray from './toArray'; import toArray from './toArray';
@@ -48,13 +54,14 @@ import toString from './toString';
export default { export default {
clone, cloneDeep, cloneDeepWith, cloneWith, eq, clone, cloneDeep, cloneDeepWith, cloneWith, eq,
gt, gte, isArguments, isArray, isArrayLike, gt, gte, isArguments, isArray, isArrayBuffer,
isArrayLikeObject, isBoolean, isDate, isElement, isEmpty, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate,
isEqual, isEqualWith, isError, isFinite, isFunction, isElement, isEmpty, isEqual, isEqualWith, isError,
isInteger, isLength, isMatch, isMatchWith, isNaN, isFinite, isFunction, isInteger, isLength, isMap,
isNative, isNil, isNull, isNumber, isObject, isMatch, isMatchWith, isNaN, isNative, isNil,
isObjectLike, isPlainObject, isRegExp, isSafeInteger, isString, isNull, isNumber, isObject, isObjectLike, isPlainObject,
isSymbol, isTypedArray, isUndefined, lt, lte, isRegExp, isSafeInteger, isSet, isString, isSymbol,
toArray, toInteger, toLength, toNumber, toPlainObject, isTypedArray, isUndefined, isWeakMap, isWeakSet, lt,
toSafeInteger, toString lte, toArray, toInteger, toLength, toNumber,
toPlainObject, toSafeInteger, toString
}; };

View File

@@ -7,9 +7,11 @@ export { default as gt } from './gt';
export { default as gte } from './gte'; export { default as gte } from './gte';
export { default as isArguments } from './isArguments'; export { default as isArguments } from './isArguments';
export { default as isArray } from './isArray'; export { default as isArray } from './isArray';
export { default as isArrayBuffer } from './isArrayBuffer';
export { default as isArrayLike } from './isArrayLike'; export { default as isArrayLike } from './isArrayLike';
export { default as isArrayLikeObject } from './isArrayLikeObject'; export { default as isArrayLikeObject } from './isArrayLikeObject';
export { default as isBoolean } from './isBoolean'; export { default as isBoolean } from './isBoolean';
export { default as isBuffer } from './isBuffer';
export { default as isDate } from './isDate'; export { default as isDate } from './isDate';
export { default as isElement } from './isElement'; export { default as isElement } from './isElement';
export { default as isEmpty } from './isEmpty'; export { default as isEmpty } from './isEmpty';
@@ -20,6 +22,7 @@ export { default as isFinite } from './isFinite';
export { default as isFunction } from './isFunction'; export { default as isFunction } from './isFunction';
export { default as isInteger } from './isInteger'; export { default as isInteger } from './isInteger';
export { default as isLength } from './isLength'; export { default as isLength } from './isLength';
export { default as isMap } from './isMap';
export { default as isMatch } from './isMatch'; export { default as isMatch } from './isMatch';
export { default as isMatchWith } from './isMatchWith'; export { default as isMatchWith } from './isMatchWith';
export { default as isNaN } from './isNaN'; export { default as isNaN } from './isNaN';
@@ -32,10 +35,13 @@ export { default as isObjectLike } from './isObjectLike';
export { default as isPlainObject } from './isPlainObject'; export { default as isPlainObject } from './isPlainObject';
export { default as isRegExp } from './isRegExp'; export { default as isRegExp } from './isRegExp';
export { default as isSafeInteger } from './isSafeInteger'; export { default as isSafeInteger } from './isSafeInteger';
export { default as isSet } from './isSet';
export { default as isString } from './isString'; export { default as isString } from './isString';
export { default as isSymbol } from './isSymbol'; export { default as isSymbol } from './isSymbol';
export { default as isTypedArray } from './isTypedArray'; export { default as isTypedArray } from './isTypedArray';
export { default as isUndefined } from './isUndefined'; export { default as isUndefined } from './isUndefined';
export { default as isWeakMap } from './isWeakMap';
export { default as isWeakSet } from './isWeakSet';
export { default as lt } from './lt'; export { default as lt } from './lt';
export { default as lte } from './lte'; export { default as lte } from './lte';
export { default as toArray } from './toArray'; export { default as toArray } from './toArray';

View File

@@ -1,6 +1,6 @@
/** /**
* @license * @license
* lodash 4.2.0 (Custom Build) <https://lodash.com/> * lodash 4.3.0 (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="es" -o ./` * Build: `lodash modularize exports="es" -o ./`
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@@ -44,7 +44,7 @@ import toInteger from './toInteger';
import lodash from './wrapperLodash'; import lodash from './wrapperLodash';
/** Used as the semantic version number. */ /** Used as the semantic version number. */
var VERSION = '4.2.0'; var VERSION = '4.3.0';
/** Used to compose bitmasks for wrapper metadata. */ /** Used to compose bitmasks for wrapper metadata. */
var BIND_KEY_FLAG = 2; var BIND_KEY_FLAG = 2;
@@ -282,9 +282,11 @@ lodash.inRange = number.inRange;
lodash.invoke = object.invoke; lodash.invoke = object.invoke;
lodash.isArguments = lang.isArguments; lodash.isArguments = lang.isArguments;
lodash.isArray = isArray; lodash.isArray = isArray;
lodash.isArrayBuffer = lang.isArrayBuffer;
lodash.isArrayLike = lang.isArrayLike; lodash.isArrayLike = lang.isArrayLike;
lodash.isArrayLikeObject = lang.isArrayLikeObject; lodash.isArrayLikeObject = lang.isArrayLikeObject;
lodash.isBoolean = lang.isBoolean; lodash.isBoolean = lang.isBoolean;
lodash.isBuffer = lang.isBuffer;
lodash.isDate = lang.isDate; lodash.isDate = lang.isDate;
lodash.isElement = lang.isElement; lodash.isElement = lang.isElement;
lodash.isEmpty = lang.isEmpty; lodash.isEmpty = lang.isEmpty;
@@ -295,6 +297,7 @@ lodash.isFinite = lang.isFinite;
lodash.isFunction = lang.isFunction; lodash.isFunction = lang.isFunction;
lodash.isInteger = lang.isInteger; lodash.isInteger = lang.isInteger;
lodash.isLength = lang.isLength; lodash.isLength = lang.isLength;
lodash.isMap = lang.isMap;
lodash.isMatch = lang.isMatch; lodash.isMatch = lang.isMatch;
lodash.isMatchWith = lang.isMatchWith; lodash.isMatchWith = lang.isMatchWith;
lodash.isNaN = lang.isNaN; lodash.isNaN = lang.isNaN;
@@ -307,10 +310,13 @@ lodash.isObjectLike = lang.isObjectLike;
lodash.isPlainObject = lang.isPlainObject; lodash.isPlainObject = lang.isPlainObject;
lodash.isRegExp = lang.isRegExp; lodash.isRegExp = lang.isRegExp;
lodash.isSafeInteger = lang.isSafeInteger; lodash.isSafeInteger = lang.isSafeInteger;
lodash.isSet = lang.isSet;
lodash.isString = lang.isString; lodash.isString = lang.isString;
lodash.isSymbol = lang.isSymbol; lodash.isSymbol = lang.isSymbol;
lodash.isTypedArray = lang.isTypedArray; lodash.isTypedArray = lang.isTypedArray;
lodash.isUndefined = lang.isUndefined; lodash.isUndefined = lang.isUndefined;
lodash.isWeakMap = lang.isWeakMap;
lodash.isWeakSet = lang.isWeakSet;
lodash.join = array.join; lodash.join = array.join;
lodash.kebabCase = string.kebabCase; lodash.kebabCase = string.kebabCase;
lodash.last = last; lodash.last = last;

View File

@@ -1,6 +1,6 @@
/** /**
* @license * @license
* lodash 4.2.0 (Custom Build) <https://lodash.com/> * lodash 4.3.0 (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="es" -o ./` * Build: `lodash modularize exports="es" -o ./`
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@@ -107,9 +107,11 @@ export { default as invoke } from './invoke';
export { default as invokeMap } from './invokeMap'; export { default as invokeMap } from './invokeMap';
export { default as isArguments } from './isArguments'; export { default as isArguments } from './isArguments';
export { default as isArray } from './isArray'; export { default as isArray } from './isArray';
export { default as isArrayBuffer } from './isArrayBuffer';
export { default as isArrayLike } from './isArrayLike'; export { default as isArrayLike } from './isArrayLike';
export { default as isArrayLikeObject } from './isArrayLikeObject'; export { default as isArrayLikeObject } from './isArrayLikeObject';
export { default as isBoolean } from './isBoolean'; export { default as isBoolean } from './isBoolean';
export { default as isBuffer } from './isBuffer';
export { default as isDate } from './isDate'; export { default as isDate } from './isDate';
export { default as isElement } from './isElement'; export { default as isElement } from './isElement';
export { default as isEmpty } from './isEmpty'; export { default as isEmpty } from './isEmpty';
@@ -120,6 +122,7 @@ export { default as isFinite } from './isFinite';
export { default as isFunction } from './isFunction'; export { default as isFunction } from './isFunction';
export { default as isInteger } from './isInteger'; export { default as isInteger } from './isInteger';
export { default as isLength } from './isLength'; export { default as isLength } from './isLength';
export { default as isMap } from './isMap';
export { default as isMatch } from './isMatch'; export { default as isMatch } from './isMatch';
export { default as isMatchWith } from './isMatchWith'; export { default as isMatchWith } from './isMatchWith';
export { default as isNaN } from './isNaN'; export { default as isNaN } from './isNaN';
@@ -132,10 +135,13 @@ export { default as isObjectLike } from './isObjectLike';
export { default as isPlainObject } from './isPlainObject'; export { default as isPlainObject } from './isPlainObject';
export { default as isRegExp } from './isRegExp'; export { default as isRegExp } from './isRegExp';
export { default as isSafeInteger } from './isSafeInteger'; export { default as isSafeInteger } from './isSafeInteger';
export { default as isSet } from './isSet';
export { default as isString } from './isString'; export { default as isString } from './isString';
export { default as isSymbol } from './isSymbol'; export { default as isSymbol } from './isSymbol';
export { default as isTypedArray } from './isTypedArray'; export { default as isTypedArray } from './isTypedArray';
export { default as isUndefined } from './isUndefined'; export { default as isUndefined } from './isUndefined';
export { default as isWeakMap } from './isWeakMap';
export { default as isWeakSet } from './isWeakSet';
export { default as iteratee } from './iteratee'; export { default as iteratee } from './iteratee';
export { default as join } from './join'; export { default as join } from './join';
export { default as kebabCase } from './kebabCase'; export { default as kebabCase } from './kebabCase';

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash-es", "name": "lodash-es",
"version": "4.2.0", "version": "4.3.0",
"description": "Lodash exported as ES modules.", "description": "Lodash exported as ES modules.",
"homepage": "https://lodash.com/custom-builds", "homepage": "https://lodash.com/custom-builds",
"license": "MIT", "license": "MIT",

View File

@@ -38,8 +38,13 @@ var PARTIAL_FLAG = 32;
* // => 'hi fred' * // => 'hi fred'
*/ */
var partial = rest(function(func, partials) { var partial = rest(function(func, partials) {
var holders = replaceHolders(partials, partial.placeholder); var placeholder = partial.placeholder,
holders = replaceHolders(partials, placeholder);
return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders); return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders);
}); });
// Assign default placeholders.
partial.placeholder = {};
export default partial; export default partial;

View File

@@ -37,8 +37,13 @@ var PARTIAL_RIGHT_FLAG = 64;
* // => 'hello fred' * // => 'hello fred'
*/ */
var partialRight = rest(function(func, partials) { var partialRight = rest(function(func, partials) {
var holders = replaceHolders(partials, partialRight.placeholder); var placeholder = partialRight.placeholder,
holders = replaceHolders(partials, placeholder);
return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders); return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders);
}); });
// Assign default placeholders.
partialRight.placeholder = {};
export default partialRight; export default partialRight;

View File

@@ -2,7 +2,7 @@ import pullAll from './pullAll';
import rest from './rest'; import rest from './rest';
/** /**
* Removes all provided values from `array` using * Removes all given values from `array` using
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons. * for equality comparisons.
* *

View File

@@ -3,7 +3,7 @@ import basePullAllBy from './_basePullAllBy';
/** /**
* This method is like `_.pullAll` except that it accepts `iteratee` which is * This method is like `_.pullAll` except that it accepts `iteratee` which is
* invoked for each element of `array` and `values` to to generate the criterion * invoked for each element of `array` and `values` to generate the criterion
* by which uniqueness is computed. The iteratee is invoked with one argument: (value). * by which uniqueness is computed. The iteratee is invoked with one argument: (value).
* *
* **Note:** Unlike `_.differenceBy`, this method mutates `array`. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.

View File

@@ -8,7 +8,7 @@ import isArray from './isArray';
* Reduces `collection` to a value which is the accumulated result of running * Reduces `collection` to a value which is the accumulated result of running
* each element in `collection` through `iteratee`, where each successive * each element in `collection` through `iteratee`, where each successive
* invocation is supplied the return value of the previous. If `accumulator` * invocation is supplied the return value of the previous. If `accumulator`
* is not provided the first element of `collection` is used as the initial * is not given the first element of `collection` is used as the initial
* value. The iteratee is invoked with four arguments: * value. The iteratee is invoked with four arguments:
* (accumulator, value, index|key, collection). * (accumulator, value, index|key, collection).
* *

View File

@@ -14,6 +14,9 @@
*/ */
function subtract(minuend, subtrahend) { function subtract(minuend, subtrahend) {
var result; var result;
if (minuend === undefined && subtrahend === undefined) {
return 0;
}
if (minuend !== undefined) { if (minuend !== undefined) {
result = minuend; result = minuend;
} }

View File

@@ -29,7 +29,7 @@ var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
* in "interpolate" delimiters, HTML-escape interpolated data properties in * in "interpolate" delimiters, HTML-escape interpolated data properties in
* "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
* properties may be accessed as free variables in the template. If a setting * properties may be accessed as free variables in the template. If a setting
* object is provided it takes precedence over `_.templateSettings` values. * object is given it takes precedence over `_.templateSettings` values.
* *
* **Note:** In the development build `_.template` utilizes * **Note:** In the development build `_.template` utilizes
* [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)

View File

@@ -15,7 +15,7 @@ var FUNC_ERROR_TEXT = 'Expected a function';
* result of the last `func` invocation. * result of the last `func` invocation.
* *
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
* on the trailing edge of the timeout only if the the throttled function is * on the trailing edge of the timeout only if the throttled function is
* invoked more than once during the `wait` timeout. * invoked more than once during the `wait` timeout.
* *
* See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)

View File

@@ -3,8 +3,8 @@ import baseUniq from './_baseUniq';
import rest from './rest'; import rest from './rest';
/** /**
* Creates an array of unique values, in order, from all of the provided arrays * Creates an array of unique values, in order, from all given arrays using
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons. * for equality comparisons.
* *
* @static * @static

View File

@@ -4,7 +4,7 @@ import toString from './toString';
var idCounter = 0; var idCounter = 0;
/** /**
* Generates a unique ID. If `prefix` is provided the ID is appended to it. * Generates a unique ID. If `prefix` is given the ID is appended to it.
* *
* @static * @static
* @memberOf _ * @memberOf _

View File

@@ -3,7 +3,7 @@ import isArrayLikeObject from './isArrayLikeObject';
import rest from './rest'; import rest from './rest';
/** /**
* Creates an array excluding all provided values using * Creates an array excluding all given values using
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons. * for equality comparisons.
* *

2
xor.js
View File

@@ -5,7 +5,7 @@ import rest from './rest';
/** /**
* Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
* of the provided arrays. * of the given arrays.
* *
* @static * @static
* @memberOf _ * @memberOf _