code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function createBindWrapper(func, thisArg) {
var Ctor = createCtorWrapper(func);
function wrapper() {
return (this instanceof wrapper ? Ctor : func).apply(thisArg, arguments);
}
return wrapper;
} | Creates a function that wraps `func` and invokes it with the `this`
binding of `thisArg`.
@private
@param {Function} func The function to bind.
@param {*} [thisArg] The `this` binding of `func`.
@returns {Function} Returns the new bound function. | createBindWrapper | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function wrapper() {
return (this instanceof wrapper ? Ctor : func).apply(thisArg, arguments);
} | Creates a function that wraps `func` and invokes it with the `this`
binding of `thisArg`.
@private
@param {Function} func The function to bind.
@param {*} [thisArg] The `this` binding of `func`.
@returns {Function} Returns the new bound function. | wrapper | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function createCompounder(callback) {
return function(string) {
var index = -1,
array = words(deburr(string)),
length = array.length,
result = '';
while (++index < length) {
result = callback(result, array[index], index);
}
return resu... | Creates a function that produces compound words out of the words in a
given string.
@private
@param {Function} callback The function invoked to combine each word.
@returns {Function} Returns the new compounder function. | createCompounder | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function createCtorWrapper(Ctor) {
return function() {
var thisBinding = baseCreate(Ctor.prototype),
result = Ctor.apply(thisBinding, arguments);
// mimic the constructor's `return` behavior
// http://es5.github.io/#x13.2.2
return isObject(result) ? result : thisBindin... | Creates a function that produces an instance of `Ctor` regardless of
whether it was invoked as part of a `new` expression or by `call` or `apply`.
@private
@param {Function} Ctor The constructor to wrap.
@returns {Function} Returns the new wrapped function. | createCtorWrapper | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, arity) {
var isBind = bitmask & BIND_FLAG,
isBindKey = bitmask & BIND_KEY_FLAG,
isCurry = bitmask & CURRY_FLAG,
isCurryRight = bitmask & CURRY_RIGHT_FLAG,
isCurryBou... | Creates a function that wraps `func` and invokes it with optional `this`
binding of, partial application, and 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 {*} [thisArg] The `this` bi... | createHybridWrapper | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function wrapper() {
var length = arguments.length,
index = length,
args = Array(length);
while (index--) {
args[index] = arguments[index];
}
if (argPos) {
args = arrayReduceRight(argPos, reorder, args);
}
if (partials) {
... | Creates a function that wraps `func` and invokes it with optional `this`
binding of, partial application, and 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 {*} [thisArg] The `this` bi... | wrapper | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function createPad(string, length, chars) {
var strLength = string.length;
length = +length;
if (strLength >= length || !nativeIsFinite(length)) {
return '';
}
var padLength = length - strLength;
chars = chars == null ? ' ' : String(chars);
return repeat(chars, ceil(pa... | Creates the pad required for `string` based on the given padding length.
The `chars` string may be truncated if the number of padding characters
exceeds the padding length.
@private
@param {string} string The string to create padding for.
@param {number} [length=0] The padding length.
@param {string} [chars=' '] The s... | createPad | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function createPartialWrapper(func, bitmask, partials, thisArg) {
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 to `composeArgs`... | Creates a function that wraps `func` and invokes it with the optional `this`
binding of `thisArg` and the `partialArgs` 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 de... | createPartialWrapper | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function wrapper() {
// avoid `arguments` object use disqualifying optimizations by
// converting it to an array before providing it to `composeArgs`
var argsIndex = -1,
argsLength = arguments.length,
leftIndex = -1,
leftLength = partials.length,
a... | Creates a function that wraps `func` and invokes it with the optional `this`
binding of `thisArg` and the `partialArgs` 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 de... | wrapper | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function createWrapper(func, bitmask, thisArg, partials, holders, argPos, arity) {
var isBindKey = bitmask & BIND_KEY_FLAG;
if (!isBindKey && !isFunction(func)) {
throw new TypeError(FUNC_ERROR_TEXT);
}
var length = partials ? partials.length : 0;
if (!length) {
bitmask &= ... | 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.
The bitmask may be composed of the following flags:
1 - `_.bind`
... | createWrapper | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function getCallback(func, thisArg, argCount) {
var result = lodash.callback || callback;
result = result === callback ? baseCallback : result;
return argCount ? result(func, thisArg, argCount) : result;
} | Gets the appropriate "callback" function. If the `_.callback` method is
customized this function returns the custom method, otherwise it returns
the `baseCallback` function. If arguments are provided the chosen function
is invoked with them and its result is returned.
@private
@returns {Function} Returns the chosen fu... | getCallback | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function getIndexOf(collection, target, fromIndex) {
var result = lodash.indexOf || indexOf;
result = result === indexOf ? baseIndexOf : result;
return collection ? result(collection, target, fromIndex) : result;
} | Gets the appropriate "indexOf" function. If the `_.indexOf` method is
customized this function returns the custom method, otherwise it returns
the `baseIndexOf` function. If arguments are provided the chosen function
is invoked with them and its result is returned.
@private
@returns {Function|number} Returns the chose... | getIndexOf | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function getView(start, end, transforms) {
var index = -1,
length = transforms ? transforms.length : 0;
while (++index < length) {
var data = transforms[index],
size = data.size;
switch (data.type) {
case 'drop': start += size; break;
case 'dr... | Gets the view, applying any `transforms` to the `start` and `end` positions.
@private
@param {number} start The start of the view.
@param {number} end The end of the view.
@param {Array} [transforms] The transformations to apply to the view.
@returns {Object} Returns an object containing the `start` and `end`
positio... | getView | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function initArrayClone(array, isDeep) {
var index = -1,
length = array.length,
result = new array.constructor(length);
if (!isDeep) {
while (++index < length) {
result[index] = array[index];
}
}
// add array properties assigned by `RegExp#exec`
... | Initializes an array clone.
@private
@param {Array} array The array to clone.
@param {boolean} [isDeep=false] Specify a deep clone.
@returns {Array} Returns the initialized array clone. | initArrayClone | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function initObjectClone(object, isDeep) {
if (!isCloneable(object)) {
return null;
}
var Ctor = object.constructor,
className = toString.call(object),
isArgs = className == argsClass || (!lodash.support.argsClass && isArguments(object)),
isObj = className == obje... | Initializes an object clone.
@private
@param {Object} object The object to clone.
@param {boolean} [isDeep=false] Specify a deep clone.
@returns {null|Object} Returns the initialized object clone. | initObjectClone | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isArrayLike(value) {
return (value && typeof value == 'object' && isLength(value.length) &&
(arrayLikeClasses[toString.call(value)] || (!lodash.support.argsClass && isArguments(value)))) || false;
} | Checks if `value` is an array-like object.
@private
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is an array-like object, else `false`. | isArrayLike | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isCloneable(value) {
return (value && cloneableClasses[toString.call(value)] && !isHostObject(value)) || false;
} | Checks if `value` is cloneable.
@private
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is cloneable, else `false`. | isCloneable | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = typeof index;
if (type == 'number') {
var length = object.length,
prereq = isLength(length) && isIndex(index, length);
} else {
prereq = type == 'string';... | 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 c... | isIterateeCall | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isLength(value) {
return typeof value == 'number' && value > -1 && value <= MAX_SAFE_INTEGER;
} | Checks if `value` is valid array-like length.
@private
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is a valid length, else `false`. | isLength | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isStrictComparable(value) {
return value === value && (value === 0 ? ((1 / value) > 0) : !isObject(value));
} | 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`. | isStrictComparable | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function pickByArray(object, props) {
object = toObject(object);
var index = -1,
length = props.length,
result = {};
while (++index < length) {
var key = props[index];
if (key in object) {
result[key] = object[key];
}
}
return result;... | A specialized version of `_.pick` that picks `object` properties
specified by the `props` array.
@private
@param {Object} object The source object.
@param {string[]} props The property names to pick.
@returns {Object} Returns the new object. | pickByArray | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function pickByCallback(object, predicate) {
var result = {};
baseForIn(object, function(value, key, object) {
if (predicate(value, key, object)) {
result[key] = value;
}
});
return result;
} | A specialized version of `_.pick` that picks `object` properties `predicate`
returns truthy for.
@private
@param {Object} object The source object.
@param {Function} predicate The function invoked per iteration.
@returns {Object} Returns the new object. | pickByCallback | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function reorder(array, indexes) {
var arrLength = array.length,
length = nativeMin(indexes.length, arrLength),
oldArray = baseSlice(array);
while (length--) {
var index = indexes[length];
array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
}
... | Reorder `array` according to the specified indexes where the element at
the first index is assigned as the first element, the element at
the second index is assigned as the second element, and so on.
@private
@param {Array} array The array to reorder.
@param {Array} indexes The arranged array indexes.
@returns {Array}... | reorder | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function shimIsPlainObject(value) {
var Ctor,
support = lodash.support;
// exit early for non `Object` objects
if (!(value && typeof value == 'object' &&
toString.call(value) == objectClass && !isHostObject(value)) ||
(!hasOwnProperty.call(value, 'constructor') &&
... | A fallback implementation of `_.isPlainObject` which checks if `value`
is an object created by the `Object` constructor or has a `[[Prototype]]`
of `null`.
@private
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is a plain object, else `false`. | shimIsPlainObject | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function shimKeys(object) {
var props = keysIn(object),
propsLength = props.length,
length = propsLength && object.length,
support = lodash.support;
var allowIndexes = typeof length == 'number' && length > 0 &&
(isArray(object) || (support.nonEnumStrings && isString(ob... | A fallback implementation of `Object.keys` which creates an array of the
own enumerable property names of `object`.
@private
@param {Object} object The object to inspect.
@returns {Array} Returns the array of property names. | shimKeys | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function toIterable(value) {
if (value == null) {
return [];
}
if (!isLength(value.length)) {
return values(value);
}
if (lodash.support.unindexedChars && isString(value)) {
return value.split('');
}
return isObject(value) ? value : Object(value);
} | Converts `value` to an array-like object if it is not one.
@private
@param {*} value The value to process.
@returns {Array|Object} Returns the array-like object. | toIterable | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function toObject(value) {
if (lodash.support.unindexedChars && isString(value)) {
var index = -1,
length = value.length,
result = Object(value);
while (++index < length) {
result[index] = value.charAt(index);
}
return result;
}
return... | Converts `value` to an object if it is not one.
@private
@param {*} value The value to process.
@returns {Object} Returns the object. | toObject | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function chunk(array, size, guard) {
size = (guard || size == null) ? 1 : nativeMax(+size || 1, 1);
var index = 0,
length = array ? array.length : 0,
resIndex = -1,
result = Array(ceil(length / size));
while (index < length) {
result[++resIndex] = slice(array, i... | Creates an array of elements split into groups the length of `size`.
If `collection` can't be split evenly, the final chunk will be the remaining
elements.
@static
@memberOf _
@category Array
@param {Array} array The array to process.
@param {numer} [size=1] The length of each chunk.
@param- {Object} [guard] Enables u... | chunk | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function compact(array) {
var index = -1,
length = array ? array.length : 0,
resIndex = -1,
result = [];
while (++index < length) {
var value = array[index];
if (value) {
result[++resIndex] = value;
}
}
return result;
} | Creates an array with all falsey values removed. The values `false`, `null`,
`0`, `""`, `undefined`, and `NaN` are all falsey.
@static
@memberOf _
@category Array
@param {Array} array The array to compact.
@returns {Array} Returns the new array of filtered values.
@example
_.compact([0, 1, false, 2, '', 3]);
// => [1... | compact | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function drop(array, n, guard) {
n = (guard || n == null) ? 1 : n;
return slice(array, n < 0 ? 0 : n);
} | Creates a slice of `array` with `n` elements dropped from the beginning.
@static
@memberOf _
@type Function
@category Array
@param {Array} array The array to query.
@param {number} [n=1] The number of elements to drop.
@param- {Object} [guard] Enables use as a callback for functions like `_.map`.
@returns {Array} Retu... | drop | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function dropRight(array, n, guard) {
var length = array ? array.length : 0;
n = (guard || n == null) ? 1 : n;
n = length - (n || 0);
return slice(array, 0, n < 0 ? 0 : n);
} | Creates a slice of `array` with `n` elements dropped from the end.
@static
@memberOf _
@type Function
@category Array
@param {Array} array The array to query.
@param {number} [n=1] The number of elements to drop.
@param- {Object} [guard] Enables use as a callback for functions like `_.map`.
@returns {Array} Returns th... | dropRight | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function dropRightWhile(array, predicate, thisArg) {
var length = array ? array.length : 0;
predicate = getCallback(predicate, thisArg, 3);
while (length-- && predicate(array[length], length, array)) {}
return slice(array, 0, length + 1);
} | Creates a slice of `array` excluding elements dropped from the end.
Elements are dropped until `predicate` returns falsey. The predicate is
bound to `thisArg` and invoked with three arguments; (value, index, array).
If a property name is provided for `predicate` the created "_.pluck" style
callback returns the propert... | dropRightWhile | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function dropWhile(array, predicate, thisArg) {
var index = -1,
length = array ? array.length : 0;
predicate = getCallback(predicate, thisArg, 3);
while (++index < length && predicate(array[index], index, array)) {}
return slice(array, index);
} | Creates a slice of `array` excluding elements dropped from the beginning.
Elements are dropped until `predicate` returns falsey. The predicate is
bound to `thisArg` and invoked with three arguments; (value, index, array).
If a property name is provided for `predicate` the created "_.pluck" style
callback returns the p... | dropWhile | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function findIndex(array, predicate, thisArg) {
var index = -1,
length = array ? array.length : 0;
predicate = getCallback(predicate, thisArg, 3);
while (++index < length) {
if (predicate(array[index], index, array)) {
return index;
}
}
return -1;
} | This method is like `_.find` except that it returns the index of the first
element `predicate` returns truthy for, instead of the element itself.
If a property name is provided for `predicate` the created "_.pluck" style
callback returns the property value of the given element.
If an object is provided for `predicate... | findIndex | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function findLastIndex(array, predicate, thisArg) {
var length = array ? array.length : 0;
predicate = getCallback(predicate, thisArg, 3);
while (length--) {
if (predicate(array[length], length, array)) {
return length;
}
}
return -1;
} | This method is like `_.findIndex` except that it iterates over elements
of `collection` from right to left.
If a property name is provided for `predicate` the created "_.pluck" style
callback returns the property value of the given element.
If an object is provided for `predicate` the created "_.where" style callback... | findLastIndex | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function first(array) {
return array ? array[0] : undefined;
} | Gets the first element of `array`.
@static
@memberOf _
@alias head
@category Array
@param {Array} array The array to query.
@returns {*} Returns the first element of `array`.
@example
_.first([1, 2, 3]);
// => 1
_.first([]);
// => undefined | first | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function flatten(array, isDeep, guard) {
var length = array ? array.length : 0;
return length ? baseFlatten(array, guard ? false : isDeep) : [];
} | Flattens a nested array. If `isDeep` is `true` the array is recursively
flattened, otherwise it is only flattened a single level.
@static
@memberOf _
@category Array
@param {Array} array The array to flatten.
@param {boolean} [isDeep=false] Specify a deep flatten.
@param- {Object} [guard] Enables use as a callback for... | flatten | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function flattenDeep(array) {
var length = array ? array.length : 0;
return length ? baseFlatten(array, true) : [];
} | Recursively flattens a nested array.
@static
@memberOf _
@category Array
@param {Array} array The array to recursively flatten.
@returns {Array} Returns the new flattened array.
@example
_.flattenDeep([1, [2], [3, [[4]]]]);
// => [1, 2, 3, 4]; | flattenDeep | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function initial(array) {
return dropRight(array, 1);
} | Gets all but the last element of `array`.
@static
@memberOf _
@category Array
@param {Array} array The array to query.
@returns {Array} Returns the slice of `array`.
@example
_.initial([1, 2, 3]);
// => [1, 2] | initial | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function last(array) {
var length = array ? array.length : 0;
return length ? array[length - 1] : undefined;
} | 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 | last | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function lastIndexOf(array, value, fromIndex) {
var length = array ? array.length : 0;
if (!length) {
return -1;
}
var index = length;
if (typeof fromIndex == 'number') {
index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1;... | This method is like `_.indexOf` except that it iterates over elements of
`array` from right to left.
@static
@memberOf _
@category Array
@param {Array} array The array to search.
@param {*} value The value to search for.
@param {boolean|number} [fromIndex=array.length-1] The index to search from
or `true` to perform ... | lastIndexOf | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function pullAt(array) {
return basePullAt(array || [], baseFlatten(arguments, false, false, 1));
} | Removes elements from `array` corresponding to the specified indexes and
returns an array of the removed elements. Indexes may be specified as an
array of indexes or as individual arguments.
**Note:** Unlike `_.at`, this method mutates `array`.
@static
@memberOf _
@category Array
@param {Array} array The array to mod... | pullAt | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function remove(array, predicate, thisArg) {
var index = -1,
length = array ? array.length : 0,
result = [];
predicate = getCallback(predicate, thisArg, 3);
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result.... | Removes all elements from `array` that `predicate` returns truthy for
and returns an array of the removed elements. The predicate is bound to
`thisArg` and invoked with three arguments; (value, index, array).
If a property name is provided for `predicate` the created "_.pluck" style
callback returns the property value... | remove | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function rest(array) {
return drop(array, 1);
} | Gets all but the first element of `array`.
@static
@memberOf _
@alias tail
@category Array
@param {Array} array The array to query.
@returns {Array} Returns the slice of `array`.
@example
_.rest([1, 2, 3]);
// => [2, 3] | rest | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function slice(array, start, end) {
var index = -1,
length = array ? array.length : 0,
endType = typeof end;
if (end && endType != 'number' && isIterateeCall(array, start, end)) {
start = 0;
end = length;
}
start = start == null ? 0 : (+start || 0);
if ... | Creates a slice of `array` from `start` up to, but not including, `end`.
**Note:** This function is used instead of `Array#slice` to support node
lists in IE < 9 and to ensure dense arrays are returned.
@static
@memberOf _
@category Array
@param {Array} array The array to slice.
@param {number} [start=0] The start po... | slice | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function sortedIndex(array, value, iteratee, thisArg) {
iteratee = iteratee == null ? identity : getCallback(iteratee, thisArg, 1);
return baseSortedIndex(array, value, iteratee);
} | Uses a binary search to determine the lowest index at which a value should
be inserted into a given sorted array in order to maintain the sort order
of the array. If an iteratee function is provided it is invoked for `value`
and each element of `array` to compute their sort ranking. The iteratee
is bound to `thisArg` a... | sortedIndex | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function sortedLastIndex(array, value, iteratee, thisArg) {
iteratee = iteratee == null ? identity : getCallback(iteratee, thisArg, 1);
return baseSortedIndex(array, value, iteratee, true);
} | This method is like `_.sortedIndex` except that it returns the highest
index at which a value should be inserted into a given sorted array in
order to maintain the sort order of the array.
@static
@memberOf _
@category Array
@param {Array} array The array to inspect.
@param {*} value The value to evaluate.
@param {Fun... | sortedLastIndex | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function take(array, n, guard) {
n = (guard || n == null) ? 1 : n;
return slice(array, 0, n < 0 ? 0 : n);
} | Creates a slice of `array` with `n` elements taken from the beginning.
@static
@memberOf _
@type Function
@category Array
@param {Array} array The array to query.
@param {number} [n=1] The number of elements to take.
@param- {Object} [guard] Enables use as a callback for functions like `_.map`.
@returns {Array} Return... | take | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function takeRight(array, n, guard) {
var length = array ? array.length : 0;
n = (guard || n == null) ? 1 : n;
n = length - (n || 0);
return slice(array, n < 0 ? 0 : n);
} | Creates a slice of `array` with `n` elements taken from the end.
@static
@memberOf _
@type Function
@category Array
@param {Array} array The array to query.
@param {number} [n=1] The number of elements to take.
@param- {Object} [guard] Enables use as a callback for functions like `_.map`.
@returns {Array} Returns the ... | takeRight | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function takeRightWhile(array, predicate, thisArg) {
var length = array ? array.length : 0;
predicate = getCallback(predicate, thisArg, 3);
while (length-- && predicate(array[length], length, array)) {}
return slice(array, length + 1);
} | Creates a slice of `array` with elements taken from the end. Elements are
taken until `predicate` returns falsey. The predicate is bound to `thisArg`
and invoked with three arguments; (value, index, array).
If a property name is provided for `predicate` the created "_.pluck" style
callback returns the property value o... | takeRightWhile | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function takeWhile(array, predicate, thisArg) {
var index = -1,
length = array ? array.length : 0;
predicate = getCallback(predicate, thisArg, 3);
while (++index < length && predicate(array[index], index, array)) {}
return slice(array, 0, index);
} | Creates a slice of `array` with elements taken from the beginning. Elements
are taken until `predicate` returns falsey. The predicate is bound to
`thisArg` and invoked with three arguments; (value, index, array).
If a property name is provided for `predicate` the created "_.pluck" style
callback returns the property v... | takeWhile | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function unzip(array) {
var index = -1,
length = isObject(length = max(array, 'length')) && length.length || 0,
result = Array(length);
while (++index < length) {
result[index] = pluck(array, index);
}
return result;
} | This method is like `_.zip` except that it accepts an array of grouped
elements and creates an array regrouping the elements to their pre `_.zip`
configuration.
@static
@memberOf _
@category Array
@param {Array} array The array of grouped elements to process.
@returns {Array} Returns the new array of regrouped element... | unzip | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function xor() {
var index = -1,
length = arguments.length;
while (++index < length) {
var array = arguments[index];
if (isArray(array) || isArguments(array)) {
var result = result
? baseDifference(result, array).concat(baseDifference(array, result))
... | Creates an array that is the symmetric difference of the provided arrays.
See [Wikipedia](http://en.wikipedia.org/wiki/Symmetric_difference) for
more details.
@static
@memberOf _
@category Array
@param {...Array} [arrays] The arrays to inspect.
@returns {Array} Returns the new array of values.
@example
_.xor([1, 2, 3... | xor | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function zip() {
var length = arguments.length,
array = Array(length);
while (length--) {
array[length] = arguments[length];
}
return unzip(array);
} | Creates an array of grouped elements, the first of which contains the first
elements of the given arrays, the second of which contains the second elements
of the given arrays, and so on.
@static
@memberOf _
@category Array
@param {...Array} [arrays] The arrays to process.
@returns {Array} Returns the new array of grou... | zip | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function zipObject(props, values) {
var index = -1,
length = props ? props.length : 0,
result = {};
if (!values && length && !isArray(props[0])) {
values = [];
}
while (++index < length) {
var key = props[index];
if (values) {
result[key] = ... | Creates an object composed from arrays of property names and values. Provide
either a single two dimensional array, e.g. `[[key1, value1], [key2, value2]]`
or two arrays, one of property names and one of corresponding values.
@static
@memberOf _
@alias object
@category Array
@param {Array} props The property names.
@p... | zipObject | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function chain(value) {
var result = lodash(value);
result.__chain__ = true;
return result;
} | Creates a `lodash` object that wraps `value` with explicit method
chaining enabled.
@static
@memberOf _
@category Chain
@param {*} value The value to wrap.
@returns {Object} Returns the new `lodash` object.
@example
var users = [
{ 'user': 'barney', 'age': 36 },
{ 'user': 'fred', 'age': 40 },
{ 'user': 'peb... | chain | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function tap(value, interceptor, thisArg) {
interceptor.call(thisArg, value);
return value;
} | This method invokes `interceptor` and returns `value`. The interceptor is
bound to `thisArg` and invoked with one argument; (value). The purpose of
this method is to "tap into" a method chain in order to perform operations
on intermediate results within the chain.
@static
@memberOf _
@category Chain
@param {*} value T... | tap | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function thru(value, interceptor, thisArg) {
return interceptor.call(thisArg, value);
} | This method is like `_.tap` except that it returns the result of `interceptor`.
@static
@memberOf _
@category Chain
@param {*} value The value to provide to `interceptor`.
@param {Function} interceptor The function to invoke.
@param {*} [thisArg] The `this` binding of `interceptor`.
@returns {*} Returns the result of ... | thru | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function wrapperChain() {
return chain(this);
} | Enables explicit method chaining on the wrapper object.
@name chain
@memberOf _
@category Chain
@returns {*} Returns the `lodash` object.
@example
var users = [
{ 'user': 'barney', 'age': 36 },
{ 'user': 'fred', 'age': 40 }
];
// without explicit chaining
_(users).first();
// => { 'user': 'barney', 'age': 36 }... | wrapperChain | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function wrapperReverse() {
return this.thru(function(value) {
return value.reverse();
});
} | Reverses the wrapped array so the first element becomes the last, the
second element becomes the second to last, and so on.
**Note:** This method mutates the wrapped array.
@name chain
@memberOf _
@category Chain
@returns {Object} Returns the new reversed `lodash` object.
@example
var array = [1, 2, 3];
_(array).re... | wrapperReverse | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function wrapperToString() {
return String(this.value());
} | Produces the result of coercing the unwrapped value to a string.
@name toString
@memberOf _
@category Chain
@returns {string} Returns the coerced string value.
@example
_([1, 2, 3]).toString();
// => '1,2,3' | wrapperToString | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function wrapperValueOf() {
var result = this.__wrapped__;
if (result instanceof LazyWrapper) {
result = result.value();
}
var index = -1,
queue = this.__queue__,
length = queue.length;
while (++index < length) {
var args = [result],
data = ... | Extracts the unwrapped value from its wrapper.
@name valueOf
@memberOf _
@alias toJSON, value
@category Chain
@returns {*} Returns the unwrapped value.
@example
_([1, 2, 3]).valueOf();
// => [1, 2, 3] | wrapperValueOf | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function at(collection) {
if (!collection || isLength(collection.length)) {
collection = toIterable(collection);
}
return baseAt(collection, baseFlatten(arguments, false, false, 1));
} | Creates an array of elements corresponding to the specified keys, or indexes,
of the collection. Keys may be specified as individual arguments or as arrays
of keys.
@static
@memberOf _
@category Collection
@param {Array|Object|string} collection The collection to iterate over.
@param {...(number|number[]|string|string... | at | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function every(collection, predicate, thisArg) {
var func = isArray(collection) ? arrayEvery : baseEvery;
if (typeof predicate != 'function' || typeof thisArg != 'undefined') {
predicate = getCallback(predicate, thisArg, 3);
}
return func(collection, predicate);
} | Checks if `predicate` returns truthy for **all** elements of `collection`.
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 "_.pluck" style
callback returns the property value of the given element.
If an ob... | every | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function filter(collection, predicate, thisArg) {
var func = isArray(collection) ? arrayFilter : baseFilter;
predicate = getCallback(predicate, thisArg, 3);
return func(collection, predicate);
} | 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).
If a property name is provided for `predicate` the created "_.pluck" style
callback returns the property value... | filter | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function find(collection, predicate, thisArg) {
if (isArray(collection)) {
var index = findIndex(collection, predicate, thisArg);
return index > -1 ? collection[index] : undefined;
}
predicate = getCallback(predicate, thisArg, 3);
return baseFind(collection, predicate, baseEach);... | 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).
If a property name is provided for `predicate` the created "_.pluck" style
callback returns the property value of the... | find | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function findLast(collection, predicate, thisArg) {
predicate = getCallback(predicate, thisArg, 3);
return baseFind(collection, predicate, baseEachRight);
} | This method is like `_.find` except that it iterates over elements of
`collection` from right to left.
@static
@memberOf _
@category Collection
@param {Array|Object|string} collection The collection to search.
@param {Function|Object|string} [predicate=_.identity] The function invoked
per iteration. If a property nam... | findLast | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function findWhere(collection, source) {
return find(collection, matches(source));
} | Performs a deep comparison between each element in `collection` and the
source object, returning the first element that has equivalent property
values.
@static
@memberOf _
@category Collection
@param {Array|Object|string} collection The collection to search.
@param {Object} source The object of property values to matc... | findWhere | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function forEach(collection, iteratee, thisArg) {
return (typeof iteratee == 'function' && typeof thisArg == 'undefined' && isArray(collection))
? arrayEach(collection, iteratee)
: baseEach(collection, baseCallback(iteratee, thisArg, 3));
} | Iterates over elements of `collection` invoking `iteratee` for each element.
The `iteratee` is bound to `thisArg` and invoked with three arguments;
(value, index|key, collection). Iterator functions may exit iteration early
by explicitly returning `false`.
**Note:** As with other "Collections" methods, objects with a ... | forEach | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function forEachRight(collection, iteratee, thisArg) {
return (typeof iteratee == 'function' && typeof thisArg == 'undefined' && isArray(collection))
? arrayEachRight(collection, iteratee)
: baseEachRight(collection, baseCallback(iteratee, thisArg, 3));
} | This method is like `_.forEach` except that it iterates over elements of
`collection` from right to left.
@static
@memberOf _
@alias eachRight
@category Collection
@param {Array|Object|string} collection The collection to iterate over.
@param {Function} [iteratee=_.identity] The function invoked per iteration.
@param ... | forEachRight | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function invoke(collection, methodName) {
return baseInvoke(collection, methodName, slice(arguments, 2));
} | Invokes the method named by `methodName` on each element in the collection,
returning an array of the results of each invoked method. Any additional
arguments are provided to each invoked method. If `methodName` is a function
it is invoked for, and `this` bound to, each element in the collection.
@static
@memberOf _
@... | invoke | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function map(collection, iteratee, thisArg) {
iteratee = getCallback(iteratee, thisArg, 3);
var func = isArray(collection) ? arrayMap : baseMap;
return func(collection, iteratee);
} | Creates an array of values by running each element in the collection through
`iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
arguments; (value, index|key, collection).
If a property name is provided for `iteratee` the created "_.pluck" style
callback returns the property value of the given elem... | map | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function max(collection, iteratee, thisArg) {
if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
iteratee = null;
}
var noIteratee = iteratee == null,
isArr = noIteratee && isArray(collection),
isStr = !isArr && isString(collection);
if (noIteratee && !i... | Retrieves the maximum value of `collection`. If the collection is empty
or falsey `-Infinity` is returned. If an iteratee function is provided it
is invoked for each value in the collection to generate the criterion by
which the value is ranked. The `iteratee` is bound to `thisArg` and invoked
with three arguments; (va... | max | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function min(collection, iteratee, thisArg) {
if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
iteratee = null;
}
var noIteratee = iteratee == null,
isArr = noIteratee && isArray(collection),
isStr = !isArr && isString(collection);
if (noIteratee && !i... | Retrieves the minimum value of `collection`. If the collection is empty
or falsey `Infinity` is returned. If an iteratee function is provided it
is invoked for each value in the collection to generate the criterion by
which the value is ranked. The `iteratee` is bound to `thisArg` and invoked
with three arguments; (val... | min | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function pluck(collection, key) {
return map(collection, property(key));
} | Retrieves the value of a specified property from all elements in the collection.
@static
@memberOf _
@category Collection
@param {Array|Object|string} collection The collection to iterate over.
@param {string} key The name of the property to pluck.
@returns {Array} Returns the property values.
@example
var users = [
... | pluck | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function reduce(collection, iteratee, accumulator, thisArg) {
var func = isArray(collection) ? arrayReduce : baseReduce;
return func(collection, getCallback(iteratee, thisArg, 4), accumulator, arguments.length < 3, baseEach);
} | Reduces a collection to a value which is the accumulated result of running
each element in the collection through `iteratee`, where each successive
invocation is supplied the return value of the previous. If `accumulator`
is not provided the first element of the collection is used as the initial
value. The `iteratee` i... | reduce | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function reduceRight(collection, iteratee, accumulator, thisArg) {
var func = isArray(collection) ? arrayReduceRight : baseReduce;
return func(collection, getCallback(iteratee, thisArg, 4), accumulator, arguments.length < 3, baseEachRight);
} | This method is like `_.reduce` except that it iterates over elements of
`collection` from right to left.
@static
@memberOf _
@alias foldr
@category Collection
@param {Array|Object|string} collection The collection to iterate over.
@param {Function} [iteratee=_.identity] The function invoked per iteration.
@param {*} [... | reduceRight | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function reject(collection, predicate, thisArg) {
var func = isArray(collection) ? arrayFilter : baseFilter;
predicate = getCallback(predicate, thisArg, 3);
return func(collection, function(value, index, collection) {
return !predicate(value, index, collection);
});
} | 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 "_.pluck" style
callback returns the property value of the given element.
If an object is provided for `predicate` the created "_.whe... | reject | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function sample(collection, n, guard) {
if (guard || n == null) {
collection = toIterable(collection);
var length = collection.length;
return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
}
var result = shuffle(collection);
result.length = nativeMin(n < ... | Retrieves a random element or `n` random elements from a collection.
@static
@memberOf _
@category Collection
@param {Array|Object|string} collection The collection to sample.
@param {number} [n] The number of elements to sample.
@param- {Object} [guard] Enables use as a callback for functions like `_.map`.
@returns {... | sample | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
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];
... | Creates an array of shuffled values, using a version of the Fisher-Yates
shuffle. See [Wikipedia](http://en.wikipedia.org/wiki/Fisher-Yates_shuffle)
for more details.
@static
@memberOf _
@category Collection
@param {Array|Object|string} collection The collection to shuffle.
@returns {Array} Returns the new shuffled ar... | shuffle | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function size(collection) {
var length = collection ? collection.length : 0;
return isLength(length) ? length : keys(collection).length;
} | Gets the size of the collection by returning `collection.length` for
array-like values or the number of own enumerable properties for objects.
@static
@memberOf _
@category Collection
@param {Array|Object|string} collection The collection to inspect.
@returns {number} Returns `collection.length` or number of own enume... | size | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function some(collection, predicate, thisArg) {
var func = isArray(collection) ? arraySome : baseSome;
if (typeof predicate != 'function' || typeof thisArg != 'undefined') {
predicate = getCallback(predicate, thisArg, 3);
}
return func(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).
If a property name is provided for `p... | some | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function sortBy(collection, iteratee, thisArg) {
if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
iteratee = null;
}
var index = -1,
length = collection ? collection.length : 0,
multi = iteratee && isArray(iteratee),
result = [];
if (isLength... | 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;
(value, index|key... | sortBy | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function toArray(collection) {
var length = collection ? collection.length : 0;
if (isLength(length)) {
return (lodash.support.unindexedChars && isString(collection))
? collection.split('')
: baseSlice(collection);
}
return values(collection);
} | Converts `collection` to an array.
@static
@memberOf _
@category Collection
@param {Array|Object|string} collection The collection to convert.
@returns {Array} Returns the new converted array.
@example
(function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4);
// => [2, 3, 4] | toArray | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function where(collection, source) {
return filter(collection, matches(source));
} | Performs a deep comparison between each element in `collection` and the
source object, returning an array of all elements that have equivalent
property values.
@static
@memberOf _
@category Collection
@param {Array|Object|string} collection The collection to search.
@param {Object} source The object of property values... | where | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function after(n, func) {
if (!isFunction(func)) {
if (isFunction(n)) {
var temp = n;
n = func;
func = temp;
} else {
throw new TypeError(FUNC_ERROR_TEXT);
}
}
n = nativeIsFinite(n = +n) ? n : 0;
return function() {
if (--n ... | The opposite of `_.before`; this method creates a function that invokes
`func` only after it is called `n` times.
@static
@memberOf _
@category Function
@param {number} n The number of calls before `func` is invoked.
@param {Function} func The function to restrict.
@returns {Function} Returns the new restricted functi... | after | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function before(n, func) {
var result;
if (!isFunction(func)) {
if (isFunction(n)) {
var temp = n;
n = func;
func = temp;
} else {
throw new TypeError(FUNC_ERROR_TEXT);
}
}
return function() {
if (--n > 0) {
result... | Creates a function that invokes `func`, with the `this` binding and arguments
of the created function, while it is called less than `n` times. Subsequent
calls to the created function return the result of the last `func` invocation.
@static
@memberOf _
@category Function
@param {number} n The number of calls at which ... | before | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function bind(func, thisArg) {
var bitmask = BIND_FLAG;
if (arguments.length > 2) {
var partials = slice(arguments, 2),
holders = replaceHolders(partials, bind.placeholder);
bitmask |= PARTIAL_FLAG;
}
return createWrapper(func, bitmask, thisArg, partials, holders);
... | Creates a function that invokes `func` with the `this` binding of `thisArg`
and prepends any additional `bind` arguments to those provided to the bound
function.
**Note:** Unlike native `Function#bind` this method does not set the `length`
property of bound functions.
@static
@memberOf _
@category Function
@param {Fu... | bind | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function bindAll(object) {
return baseBindAll(object,
arguments.length > 1
? baseFlatten(arguments, false, false, 1)
: functions(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 `len... | bindAll | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function bindKey(object, key) {
var bitmask = BIND_FLAG | BIND_KEY_FLAG;
if (arguments.length > 2) {
var partials = slice(arguments, 2),
holders = replaceHolders(partials, bindKey.placeholder);
bitmask |= PARTIAL_FLAG;
}
return createWrapper(key, bitmask, object, par... | Creates a function that invokes the method at `object[key]` and prepends
any additional `bindKey` arguments to those provided to the bound function.
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.c... | bindKey | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function curry(func, arity, guard) {
var result = createWrapper(func, CURRY_FLAG, null, null, null, null, guard ? null : arity);
result.placeholder = curry.placeholder;
return result;
} | 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` can be specified
if `func.length` is n... | curry | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function curryRight(func, arity, guard) {
var result = createWrapper(func, CURRY_RIGHT_FLAG, null, null, null, null, guard ? null : arity);
result.placeholder = curryRight.placeholder;
return result;
} | This method is like `_.curry` except that arguments are applied to `func`
in the manner of `_.partialRight` instead of `_.partial`.
**Note:** This method does not set the `length` property of curried functions.
@static
@memberOf _
@category Function
@param {Function} func The function to curry.
@param {number} [arity... | curryRight | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function debounce(func, wait, options) {
var args,
maxTimeoutId,
result,
stamp,
thisArg,
timeoutId,
trailingCall,
lastCalled = 0,
maxWait = false,
trailing = true;
if (!isFunction(func)) {
throw new TypeError(... | 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 ... | debounce | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function cancel() {
if (timeoutId) {
clearTimeout(timeoutId);
}
if (maxTimeoutId) {
clearTimeout(maxTimeoutId);
}
maxTimeoutId = timeoutId = trailingCall = undefined;
} | 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 ... | cancel | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function delayed() {
var remaining = wait - (now() - stamp);
if (remaining <= 0 || remaining > wait) {
if (maxTimeoutId) {
clearTimeout(maxTimeoutId);
}
var isCalled = trailingCall;
maxTimeoutId = timeoutId = trailingCall = undefined;
if (isC... | 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 ... | delayed | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function maxDelayed() {
if (timeoutId) {
clearTimeout(timeoutId);
}
maxTimeoutId = timeoutId = trailingCall = undefined;
if (trailing || (maxWait !== wait)) {
lastCalled = now();
result = func.apply(thisArg, args);
if (!timeoutId && !maxTimeoutId) ... | 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 ... | maxDelayed | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function debounced() {
args = arguments;
stamp = now();
thisArg = this;
trailingCall = trailing && (timeoutId || !leading);
if (maxWait === false) {
var leadingCall = leading && !timeoutId;
} else {
if (!maxTimeoutId && !leading) {
lastCal... | 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 ... | debounced | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function defer(func) {
if (!isFunction(func)) {
throw new TypeError(FUNC_ERROR_TEXT);
}
var args = arguments;
return setTimeout(function() { func.apply(undefined, slice(args, 1)); }, 1);
} | Defers invoking the `func` until the current call stack has cleared. Any
additional arguments are provided to `func` when it is invoked.
@static
@memberOf _
@category Function
@param {Function} func The function to defer.
@param {...*} [args] The arguments to invoke the function with.
@returns {number} Returns the tim... | defer | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function delay(func, wait) {
if (!isFunction(func)) {
throw new TypeError(FUNC_ERROR_TEXT);
}
var args = arguments;
return setTimeout(function() { func.apply(undefined, slice(args, 2)); }, wait);
} | Invokes `func` after `wait` milliseconds. Any additional arguments are
provided to `func` when it is invoked.
@static
@memberOf _
@category Function
@param {Function} func The function to delay.
@param {number} wait The number of milliseconds to delay invocation.
@param {...*} [args] The arguments to invoke the functi... | delay | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function flow() {
var funcs = arguments,
length = funcs.length;
if (!length) {
return function() {};
}
if (!arrayEvery(funcs, isFunction)) {
throw new TypeError(FUNC_ERROR_TEXT);
}
return function() {
var index = 0,
result = funcs[index]... | Creates a function that invokes the provided functions with the `this`
binding of the created function, where each successive invocation is
supplied the return value of the previous.
@static
@memberOf _
@category Function
@param {...Function} [funcs] Functions to invoke.
@returns {Function} Returns the new function.
@... | flow | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.