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 size(collection) {
var length = collection ? collection.length : 0;
return typeof length == 'number' ? length : keys(collection).length;
} | Gets the size of the `collection` by returning `collection.length` for arrays
and array-like objects or the number of own enumerable properties for objects.
@static
@memberOf _
@category Collections
@param {Array|Object|string} collection The collection to inspect.
@returns {number} Returns `collection.length` or numb... | size | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function some(collection, callback, thisArg) {
var result;
callback = lodash.createCallback(callback, thisArg, 3);
if (isArray(collection)) {
var index = -1,
length = collection.length;
while (++index < length) {
if ((result = callback(collection[index], index, ... | Checks if the callback returns a truey value for **any** element of a
collection. The function returns as soon as it finds a passing value and
does not iterate over the entire collection. The callback is bound to
`thisArg` and invoked with three arguments; (value, index|key, collection).
If a property name is provided... | some | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function sortBy(collection, callback, thisArg) {
var index = -1,
isArr = isArray(callback),
length = collection ? collection.length : 0,
result = Array(typeof length == 'number' ? length : 0);
if (!isArr) {
callback = lodash.createCallback(callback, thisArg, 3);
... | Creates an array of elements, sorted in ascending order by the results of
running each element in a collection through the callback. This method
performs a stable sort, that is, it will preserve the original sort order
of equal elements. The callback is bound to `thisArg` and invoked with
three arguments; (value, index... | sortBy | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function toArray(collection) {
if (collection && typeof collection.length == 'number') {
return (support.unindexedChars && isString(collection))
? collection.split('')
: slice(collection);
}
return values(collection);
} | Converts the `collection` to an array.
@static
@memberOf _
@category Collections
@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 | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function compact(array) {
var index = -1,
length = array ? array.length : 0,
result = [];
while (++index < length) {
var value = array[index];
if (value) {
result.push(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 Arrays
@param {Array} array The array to compact.
@returns {Array} Returns a new array of filtered values.
@example
_.compact([0, 1, false, 2, '', 3]);
// => [1,... | compact | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function difference(array) {
return baseDifference(array, baseFlatten(arguments, true, true, 1));
} | Creates an array excluding all values of the provided arrays using strict
equality for comparisons, i.e. `===`.
@static
@memberOf _
@category Arrays
@param {Array} array The array to process.
@param {...Array} [values] The arrays of values to exclude.
@returns {Array} Returns a new array of filtered values.
@example
... | difference | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function findIndex(array, callback, thisArg) {
var index = -1,
length = array ? array.length : 0;
callback = lodash.createCallback(callback, thisArg, 3);
while (++index < length) {
if (callback(array[index], index, array)) {
return index;
}
}
return -1;... | This method is like `_.find` except that it returns the index of the first
element that passes the callback check, instead of the element itself.
If a property name is provided for `callback` the created "_.pluck" style
callback will return the property value of the given element.
If an object is provided for `callba... | findIndex | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function findLastIndex(array, callback, thisArg) {
var length = array ? array.length : 0;
callback = lodash.createCallback(callback, thisArg, 3);
while (length--) {
if (callback(array[length], length, array)) {
return length;
}
}
return -1;
} | This method is like `_.findIndex` except that it iterates over elements
of a `collection` from right to left.
If a property name is provided for `callback` the created "_.pluck" style
callback will return the property value of the given element.
If an object is provided for `callback` the created "_.where" style call... | findLastIndex | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function first(array, callback, thisArg) {
var n = 0,
length = array ? array.length : 0;
if (typeof callback != 'number' && callback != null) {
var index = -1;
callback = lodash.createCallback(callback, thisArg, 3);
while (++index < length && callback(array[index], index, ... | Gets the first element or first `n` elements of an array. If a callback
is provided elements at the beginning of the array are returned as long
as the callback returns truey. The callback is bound to `thisArg` and
invoked with three arguments; (value, index, array).
If a property name is provided for `callback` the cr... | first | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function flatten(array, isShallow, callback, thisArg) {
// juggle arguments
if (typeof isShallow != 'boolean' && isShallow != null) {
thisArg = callback;
callback = (typeof isShallow != 'function' && thisArg && thisArg[isShallow] === array) ? null : isShallow;
isShallow = false;
... | Flattens a nested array (the nesting can be to any depth). If `isShallow`
is truey, the array will only be flattened a single level. If a callback
is provided each element of the array is passed through the callback before
flattening. The callback is bound to `thisArg` and invoked with three
arguments; (value, index, a... | flatten | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function indexOf(array, value, fromIndex) {
if (typeof fromIndex == 'number') {
var length = array ? array.length : 0;
fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0);
} else if (fromIndex) {
var index = sortedIndex(array, value);
return array[... | Gets the index at which the first occurrence of `value` is found using
strict equality for comparisons, i.e. `===`. If the array is already sorted
providing `true` for `fromIndex` will run a faster binary search.
@static
@memberOf _
@category Arrays
@param {Array} array The array to search.
@param {*} value The value ... | indexOf | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function initial(array, callback, thisArg) {
var n = 0,
length = array ? array.length : 0;
if (typeof callback != 'number' && callback != null) {
var index = length;
callback = lodash.createCallback(callback, thisArg, 3);
while (index-- && callback(array[index], index, arr... | Gets all but the last element or last `n` elements of an array. If a
callback is provided elements at the end of the array are excluded from
the result as long as the callback returns truey. The callback is bound
to `thisArg` and invoked with three arguments; (value, index, array).
If a property name is provided for `... | initial | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function intersection() {
var args = [],
argsIndex = -1,
argsLength = arguments.length,
caches = getArray(),
indexOf = getIndexOf(),
trustIndexOf = indexOf === baseIndexOf,
seen = getArray();
while (++argsIndex < argsLength) {
var value = ... | Creates an array of unique values present in all provided arrays using
strict equality for comparisons, i.e. `===`.
@static
@memberOf _
@category Arrays
@param {...Array} [array] The arrays to inspect.
@returns {Array} Returns an array of shared values.
@example
_.intersection([1, 2, 3], [5, 2, 1, 4], [2, 1]);
// => ... | intersection | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function last(array, callback, thisArg) {
var n = 0,
length = array ? array.length : 0;
if (typeof callback != 'number' && callback != null) {
var index = length;
callback = lodash.createCallback(callback, thisArg, 3);
while (index-- && callback(array[index], index, array)... | Gets the last element or last `n` elements of an array. If a callback is
provided elements at the end of the array are returned as long as the
callback returns truey. The callback is bound to `thisArg` and invoked
with three arguments; (value, index, array).
If a property name is provided for `callback` the created "_... | last | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function lastIndexOf(array, value, fromIndex) {
var index = array ? array.length : 0;
if (typeof fromIndex == 'number') {
index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1;
}
while (index--) {
if (array[index] === value) {
r... | Gets the index at which the last occurrence of `value` is found using strict
equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used
as the offset from the end of the collection.
If a property name is provided for `callback` the created "_.pluck" style
callback will return the property value of th... | lastIndexOf | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function pull(array) {
var args = arguments,
argsIndex = 0,
argsLength = args.length,
length = array ? array.length : 0;
while (++argsIndex < argsLength) {
var index = -1,
value = args[argsIndex];
while (++index < length) {
if (array[index... | Removes all provided values from the given array using strict equality for
comparisons, i.e. `===`.
@static
@memberOf _
@category Arrays
@param {Array} array The array to modify.
@param {...*} [value] The values to remove.
@returns {Array} Returns `array`.
@example
var array = [1, 2, 3, 1, 2, 3];
_.pull(array, 2, 3);... | pull | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function range(start, end, step) {
start = +start || 0;
step = typeof step == 'number' ? step : (+step || 1);
if (end == null) {
end = start;
start = 0;
}
// use `Array(length)` so engines like Chakra and V8 avoid slower modes
// http://youtu.be/XAqIpGU8ZZk#t=17m25s
... | Creates an array of numbers (positive and/or negative) progressing from
`start` up to but not including `end`. If `start` is less than `stop` a
zero-length range is created unless a negative `step` is specified.
@static
@memberOf _
@category Arrays
@param {number} [start=0] The start of the range.
@param {number} end ... | range | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function remove(array, callback, thisArg) {
var index = -1,
length = array ? array.length : 0,
result = [];
callback = lodash.createCallback(callback, thisArg, 3);
while (++index < length) {
var value = array[index];
if (callback(value, index, array)) {
r... | Removes all elements from an array that the callback returns truey for
and returns an array of removed elements. The callback is bound to `thisArg`
and invoked with three arguments; (value, index, array).
If a property name is provided for `callback` the created "_.pluck" style
callback will return the property value ... | remove | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function rest(array, callback, thisArg) {
if (typeof callback != 'number' && callback != null) {
var n = 0,
index = -1,
length = array ? array.length : 0;
callback = lodash.createCallback(callback, thisArg, 3);
while (++index < length && callback(array[index], inde... | The opposite of `_.initial` this method gets all but the first element or
first `n` elements of an array. If a callback function is provided elements
at the beginning of the array are excluded from the result as long as the
callback returns truey. The callback is bound to `thisArg` and invoked
with three arguments; (va... | rest | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function sortedIndex(array, value, callback, thisArg) {
var low = 0,
high = array ? array.length : low;
// explicitly reference `identity` for better inlining in Firefox
callback = callback ? lodash.createCallback(callback, thisArg, 1) : identity;
value = callback(value);
while... | Uses a binary search to determine the smallest index at which a value
should be inserted into a given sorted array in order to maintain the sort
order of the array. If a callback is provided it will be executed for
`value` and each element of `array` to compute their sort ranking. The
callback is bound to `thisArg` and... | sortedIndex | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function union() {
return baseUniq(baseFlatten(arguments, true, true));
} | Creates an array of unique values, in order, of the provided arrays using
strict equality for comparisons, i.e. `===`.
@static
@memberOf _
@category Arrays
@param {...Array} [array] The arrays to inspect.
@returns {Array} Returns an array of combined values.
@example
_.union([1, 2, 3], [5, 2, 1, 4], [2, 1]);
// => [1... | union | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function uniq(array, isSorted, callback, thisArg) {
// juggle arguments
if (typeof isSorted != 'boolean' && isSorted != null) {
thisArg = callback;
callback = (typeof isSorted != 'function' && thisArg && thisArg[isSorted] === array) ? null : isSorted;
isSorted = false;
}
... | Creates a duplicate-value-free version of an array using strict equality
for comparisons, i.e. `===`. If the array is sorted, providing
`true` for `isSorted` will use a faster algorithm. If a callback is provided
each element of `array` is passed through the callback before uniqueness
is computed. The callback is bound... | uniq | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function without(array) {
return baseDifference(array, slice(arguments, 1));
} | Creates an array excluding all provided values using strict equality for
comparisons, i.e. `===`.
@static
@memberOf _
@category Arrays
@param {Array} array The array to filter.
@param {...*} [value] The values to exclude.
@returns {Array} Returns a new array of filtered values.
@example
_.without([1, 2, 1, 0, 3, 1, 4... | without | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.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
? baseUniq(baseDifference(result, array).concat(baseDifference(array, result))... | Creates an array that is the symmetric difference of the provided arrays.
See http://en.wikipedia.org/wiki/Symmetric_difference.
@static
@memberOf _
@category Arrays
@param {...Array} [array] The arrays to inspect.
@returns {Array} Returns an array of values.
@example
_.xor([1, 2, 3], [5, 2, 1, 4]);
// => [3, 5, 4]
... | xor | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function zip() {
var array = arguments.length > 1 ? arguments : arguments[0],
index = -1,
length = array ? max(pluck(array, 'length')) : 0,
result = Array(length < 0 ? 0 : length);
while (++index < length) {
result[index] = pluck(array, index);
}
return res... | 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 _
@alias unzip
@category Arrays
@param {...Array} [array] Arrays to process.
@returns {Array} Returns a new array ... | zip | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function zipObject(keys, values) {
var index = -1,
length = keys ? keys.length : 0,
result = {};
if (!values && length && !isArray(keys[0])) {
values = [];
}
while (++index < length) {
var key = keys[index];
if (values) {
result[key] = value... | Creates an object composed from arrays of `keys` and `values`. Provide
either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`
or two arrays, one of `keys` and one of corresponding `values`.
@static
@memberOf _
@alias object
@category Arrays
@param {Array} keys The array of keys.
@param {Array} ... | zipObject | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function after(n, func) {
if (!isFunction(func)) {
throw new TypeError;
}
return function() {
if (--n < 1) {
return func.apply(this, arguments);
}
};
} | Creates a function that executes `func`, with the `this` binding and
arguments of the created function, only after being called `n` times.
@static
@memberOf _
@category Functions
@param {number} n The number of times the function must be called before
`func` is executed.
@param {Function} func The function to restri... | after | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function bind(func, thisArg) {
return arguments.length > 2
? createWrapper(func, 17, slice(arguments, 2), null, thisArg)
: createWrapper(func, 1, null, null, thisArg);
} | Creates a function that, when called, invokes `func` with the `this`
binding of `thisArg` and prepends any additional `bind` arguments to those
provided to the bound function.
@static
@memberOf _
@category Functions
@param {Function} func The function to bind.
@param {*} [thisArg] The `this` binding of `func`.
@param ... | bind | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function bindAll(object) {
var funcs = arguments.length > 1 ? baseFlatten(arguments, true, false, 1) : functions(object),
index = -1,
length = funcs.length;
while (++index < length) {
var key = funcs[index];
object[key] = createWrapper(object[key], 1, null, null, 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 the function properties
of `object` will be bound.
@static
@memberOf _
@category Functions
@param {Object} object The... | bindAll | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function bindKey(object, key) {
return arguments.length > 2
? createWrapper(key, 19, slice(arguments, 2), null, object)
: createWrapper(key, 3, null, null, object);
} | Creates a function that, when called, 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 will be redefined or don't yet exist.
See http://michaux.ca/articles/... | bindKey | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function compose() {
var funcs = arguments,
length = funcs.length;
while (length--) {
if (!isFunction(funcs[length])) {
throw new TypeError;
}
}
return function() {
var args = arguments,
length = funcs.length;
while (length--) {
... | Creates a function that is the composition of the provided functions,
where each function consumes the return value of the function that follows.
For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`.
Each function is executed with the `this` binding of the composed function.
@static
@membe... | compose | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function curry(func, arity) {
arity = typeof arity == 'number' ? arity : (+arity || func.length);
return createWrapper(func, 4, null, null, null, arity);
} | Creates a function which accepts one or more arguments of `func` that when
invoked either executes `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` i... | curry | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.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 will delay the execution of `func` until after
`wait` milliseconds have elapsed since the last time it was invoked.
Provide an options object to indicate that `func` should be invoked on
the leading and/or trailing edge of the `wait` timeout. Subsequent calls
to the debounced function will retur... | debounce | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
delayed = function() {
var remaining = wait - (now() - stamp);
if (remaining <= 0) {
if (maxTimeoutId) {
clearTimeout(maxTimeoutId);
}
var isCalled = trailingCall;
maxTimeoutId = timeoutId = trailingCall = undefined;
if (isCalled) {
... | Creates a function that will delay the execution of `func` until after
`wait` milliseconds have elapsed since the last time it was invoked.
Provide an options object to indicate that `func` should be invoked on
the leading and/or trailing edge of the `wait` timeout. Subsequent calls
to the debounced function will retur... | delayed | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
maxDelayed = function() {
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 will delay the execution of `func` until after
`wait` milliseconds have elapsed since the last time it was invoked.
Provide an options object to indicate that `func` should be invoked on
the leading and/or trailing edge of the `wait` timeout. Subsequent calls
to the debounced function will retur... | maxDelayed | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function defer(func) {
if (!isFunction(func)) {
throw new TypeError;
}
var args = slice(arguments, 1);
return setTimeout(function() { func.apply(undefined, args); }, 1);
} | Defers executing the `func` function until the current call stack has cleared.
Additional arguments will be provided to `func` when it is invoked.
@static
@memberOf _
@category Functions
@param {Function} func The function to defer.
@param {...*} [arg] Arguments to invoke the function with.
@returns {number} Returns t... | defer | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function delay(func, wait) {
if (!isFunction(func)) {
throw new TypeError;
}
var args = slice(arguments, 2);
return setTimeout(function() { func.apply(undefined, args); }, wait);
} | Executes the `func` function after `wait` milliseconds. Additional arguments
will be provided to `func` when it is invoked.
@static
@memberOf _
@category Functions
@param {Function} func The function to delay.
@param {number} wait The number of milliseconds to delay execution.
@param {...*} [arg] Arguments to invoke t... | delay | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function memoize(func, resolver) {
if (!isFunction(func)) {
throw new TypeError;
}
var memoized = function() {
var cache = memoized.cache,
key = resolver ? resolver.apply(this, arguments) : keyPrefix + arguments[0];
return hasOwnProperty.call(cache, key)
... | Creates a function that memoizes the result of `func`. If `resolver` is
provided it will be used to determine the cache key for storing the result
based on the arguments provided to the memoized function. By default, the
first argument provided to the memoized function is used as the cache key.
The `func` is executed w... | memoize | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
memoized = function() {
var cache = memoized.cache,
key = resolver ? resolver.apply(this, arguments) : keyPrefix + arguments[0];
return hasOwnProperty.call(cache, key)
? cache[key]
: (cache[key] = func.apply(this, arguments));
} | Creates a function that memoizes the result of `func`. If `resolver` is
provided it will be used to determine the cache key for storing the result
based on the arguments provided to the memoized function. By default, the
first argument provided to the memoized function is used as the cache key.
The `func` is executed w... | memoized | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function once(func) {
var ran,
result;
if (!isFunction(func)) {
throw new TypeError;
}
return function() {
if (ran) {
return result;
}
ran = true;
result = func.apply(this, arguments);
// clear the `func` variable so the funct... | Creates a function that is restricted to execute `func` once. Repeat calls to
the function will return the value of the first call. The `func` is executed
with the `this` binding of the created function.
@static
@memberOf _
@category Functions
@param {Function} func The function to restrict.
@returns {Function} Return... | once | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function partial(func) {
return createWrapper(func, 16, slice(arguments, 1));
} | Creates a function that, when called, invokes `func` with any additional
`partial` arguments prepended to those provided to the new function. This
method is similar to `_.bind` except it does **not** alter the `this` binding.
@static
@memberOf _
@category Functions
@param {Function} func The function to partially appl... | partial | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function partialRight(func) {
return createWrapper(func, 32, null, slice(arguments, 1));
} | This method is like `_.partial` except that `partial` arguments are
appended to those provided to the new function.
@static
@memberOf _
@category Functions
@param {Function} func The function to partially apply arguments to.
@param {...*} [arg] Arguments to be partially applied.
@returns {Function} Returns the new par... | partialRight | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function throttle(func, wait, options) {
var leading = true,
trailing = true;
if (!isFunction(func)) {
throw new TypeError;
}
if (options === false) {
leading = false;
} else if (isObject(options)) {
leading = 'leading' in options ? options.leading : lead... | Creates a function that, when executed, will only call the `func` function
at most once per every `wait` milliseconds. Provide an options object to
indicate that `func` should be invoked on the leading and/or trailing edge
of the `wait` timeout. Subsequent calls to the throttled function will
return the result of the l... | throttle | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function wrap(value, wrapper) {
return createWrapper(wrapper, 16, [value]);
} | Creates a function that provides `value` to the wrapper function as its
first argument. Additional arguments provided to the function are appended
to those provided to the wrapper function. The wrapper is executed with
the `this` binding of the created function.
@static
@memberOf _
@category Functions
@param {*} value... | wrap | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function constant(value) {
return function() {
return value;
};
} | Creates a function that returns `value`.
@static
@memberOf _
@category Utilities
@param {*} value The value to return from the new function.
@returns {Function} Returns the new function.
@example
var object = { 'name': 'fred' };
var getter = _.constant(object);
getter() === object;
// => true | constant | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function createCallback(func, thisArg, argCount) {
var type = typeof func;
if (func == null || type == 'function') {
return baseCreateCallback(func, thisArg, argCount);
}
// handle "_.pluck" style callback shorthands
if (type != 'object') {
return property(func);
}
... | Produces a callback bound to an optional `thisArg`. If `func` is a property
name the created callback will return the property value for a given element.
If `func` is an object the created callback will return `true` for elements
that contain the equivalent object properties, otherwise it will return `false`.
@static
... | createCallback | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function escape(string) {
return string == null ? '' : String(string).replace(reUnescapedHtml, escapeHtmlChar);
} | Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their
corresponding HTML entities.
@static
@memberOf _
@category Utilities
@param {string} string The string to escape.
@returns {string} Returns the escaped string.
@example
_.escape('Fred, Wilma, & Pebbles');
// => 'Fred, Wilma, & Pebbles' | escape | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function identity(value) {
return value;
} | This method returns the first argument provided to it.
@static
@memberOf _
@category Utilities
@param {*} value Any value.
@returns {*} Returns `value`.
@example
var object = { 'name': 'fred' };
_.identity(object) === object;
// => true | identity | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function mixin(object, source, options) {
var chain = true,
methodNames = source && functions(source);
if (!source || (!options && !methodNames.length)) {
if (options == null) {
options = source;
}
ctor = lodashWrapper;
source = object;
object = l... | Adds function properties of a source object to the destination object.
If `object` is a function methods will be added to its prototype as well.
@static
@memberOf _
@category Utilities
@param {Function|Object} [object=lodash] object The destination object.
@param {Object} source The object of functions to add.
@param ... | mixin | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function noConflict() {
context._ = oldDash;
return this;
} | Reverts the '_' variable to its previous value and returns a reference to
the `lodash` function.
@static
@memberOf _
@category Utilities
@returns {Function} Returns the `lodash` function.
@example
var lodash = _.noConflict(); | noConflict | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function noop() {
// no operation performed
} | A no-operation function.
@static
@memberOf _
@category Utilities
@example
var object = { 'name': 'fred' };
_.noop(object) === undefined;
// => true | noop | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function property(key) {
return function(object) {
return object[key];
};
} | Creates a "_.pluck" style function, which returns the `key` value of a
given object.
@static
@memberOf _
@category Utilities
@param {string} key The name of the property to retrieve.
@returns {Function} Returns the new function.
@example
var characters = [
{ 'name': 'fred', 'age': 40 },
{ 'name': 'barney', 'age... | property | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function random(min, max, floating) {
var noMin = min == null,
noMax = max == null;
if (floating == null) {
if (typeof min == 'boolean' && noMax) {
floating = min;
min = 1;
}
else if (!noMax && typeof max == 'boolean') {
floating = max;
... | Produces a random number between `min` and `max` (inclusive). If only one
argument is provided a number between `0` and the given number will be
returned. If `floating` is truey or either `min` or `max` are floats a
floating-point number will be returned instead of an integer.
@static
@memberOf _
@category Utilities
@... | random | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function result(object, key) {
if (object) {
var value = object[key];
return isFunction(value) ? object[key]() : value;
}
} | Resolves the value of property `key` on `object`. If `key` is a function
it will be invoked with the `this` binding of `object` and its result returned,
else the property value is returned. If `object` is falsey then `undefined`
is returned.
@static
@memberOf _
@category Utilities
@param {Object} object The object to ... | result | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function times(n, callback, thisArg) {
n = (n = +n) > -1 ? n : 0;
var index = -1,
result = Array(n);
callback = baseCreateCallback(callback, thisArg, 1);
while (++index < n) {
result[index] = callback(index);
}
return result;
} | Executes the callback `n` times, returning an array of the results
of each callback execution. The callback is bound to `thisArg` and invoked
with one argument; (index).
@static
@memberOf _
@category Utilities
@param {number} n The number of times to execute the callback.
@param {Function} callback The function called... | times | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function unescape(string) {
return string == null ? '' : String(string).replace(reEscapedHtml, unescapeHtmlChar);
} | The inverse of `_.escape` this method converts the HTML entities
`&`, `<`, `>`, `"`, and `'` in `string` to their
corresponding characters.
@static
@memberOf _
@category Utilities
@param {string} string The string to unescape.
@returns {string} Returns the unescaped string.
@example
_.unescape('Fre... | unescape | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function uniqueId(prefix) {
var id = ++idCounter;
return String(prefix == null ? '' : prefix) + id;
} | Generates a unique ID. If `prefix` is provided the ID will be appended to it.
@static
@memberOf _
@category Utilities
@param {string} [prefix] The value to prefix the ID with.
@returns {string} Returns the unique ID.
@example
_.uniqueId('contact_');
// => 'contact_104'
_.uniqueId();
// => '105' | uniqueId | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function chain(value) {
value = new lodashWrapper(value);
value.__chain__ = true;
return value;
} | Creates a `lodash` object that wraps the given value with explicit
method chaining enabled.
@static
@memberOf _
@category Chaining
@param {*} value The value to wrap.
@returns {Object} Returns the wrapper object.
@example
var characters = [
{ 'name': 'barney', 'age': 36 },
{ 'name': 'fred', 'age': 40 },
{ '... | chain | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function tap(value, interceptor) {
interceptor(value);
return value;
} | Invokes `interceptor` with the `value` as the first argument and then
returns `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 Chaining
@param {*} value The value to provide to `interceptor`.
@para... | tap | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function wrapperChain() {
this.__chain__ = true;
return this;
} | Enables explicit method chaining on the wrapper object.
@name chain
@memberOf _
@category Chaining
@returns {*} Returns the wrapper object.
@example
var characters = [
{ 'name': 'barney', 'age': 36 },
{ 'name': 'fred', 'age': 40 }
];
// without explicit chaining
_(characters).first();
// => { 'name': 'barney',... | wrapperChain | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function wrapperToString() {
return String(this.__wrapped__);
} | Produces the `toString` result of the wrapped value.
@name toString
@memberOf _
@category Chaining
@returns {string} Returns the string result.
@example
_([1, 2, 3]).toString();
// => '1,2,3' | wrapperToString | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function wrapperValueOf() {
return this.__wrapped__;
} | Extracts the wrapped value.
@name valueOf
@memberOf _
@alias value
@category Chaining
@returns {*} Returns the wrapped value.
@example
_([1, 2, 3]).valueOf();
// => [1, 2, 3] | wrapperValueOf | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.compat.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.compat.js | MIT |
function baseIndexOf(array, value, fromIndex) {
var index = (fromIndex || 0) - 1,
length = array ? array.length : 0;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
} | The base implementation of `_.indexOf` without support for binary searches
or `fromIndex` constraints.
@private
@param {Array} array The array to search.
@param {*} value The value to search for.
@param {number} [fromIndex=0] The index to search from.
@returns {number} Returns the index of the matched value or `-1`. | baseIndexOf | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function cacheIndexOf(cache, value) {
var type = typeof value;
cache = cache.cache;
if (type == 'boolean' || value == null) {
return cache[value] ? 0 : -1;
}
if (type != 'number' && type != 'string') {
type = 'object';
}
var key = type == 'number' ? value : keyPrefix + value;
... | An implementation of `_.contains` for cache objects that mimics the return
signature of `_.indexOf` by returning `0` if the value is found, else `-1`.
@private
@param {Object} cache The cache object to inspect.
@param {*} value The value to search for.
@returns {number} Returns `0` if `value` is found, else `-1`. | cacheIndexOf | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function cachePush(value) {
var cache = this.cache,
type = typeof value;
if (type == 'boolean' || value == null) {
cache[value] = true;
} else {
if (type != 'number' && type != 'string') {
type = 'object';
}
var key = type == 'number' ? value : keyPrefix + value,
... | Adds a given value to the corresponding cache object.
@private
@param {*} value The value to add to the cache. | cachePush | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function charAtCallback(value) {
return value.charCodeAt(0);
} | Used by `_.max` and `_.min` as the default callback when a given
collection is a string value.
@private
@param {string} value The character to inspect.
@returns {number} Returns the code unit of given character. | charAtCallback | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function compareAscending(a, b) {
var ac = a.criteria,
bc = b.criteria,
index = -1,
length = ac.length;
while (++index < length) {
var value = ac[index],
other = bc[index];
if (value !== other) {
if (value > other || typeof value == 'undefined') {
... | Used by `sortBy` to compare transformed `collection` elements, stable sorting
them in ascending order.
@private
@param {Object} a The object to compare to `b`.
@param {Object} b The object to compare to `a`.
@returns {number} Returns the sort order indicator of `1` or `-1`. | compareAscending | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function createCache(array) {
var index = -1,
length = array.length,
first = array[0],
mid = array[(length / 2) | 0],
last = array[length - 1];
if (first && typeof first == 'object' &&
mid && typeof mid == 'object' && last && typeof last == 'object') {
return false... | Creates a cache object to optimize linear searches of large arrays.
@private
@param {Array} [array=[]] The array to search.
@returns {null|Object} Returns the cache object or `null` if caching should not be used. | createCache | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function escapeStringChar(match) {
return '\\' + stringEscapes[match];
} | Used by `template` to escape characters for inclusion in compiled
string literals.
@private
@param {string} match The matched character to escape.
@returns {string} Returns the escaped character. | escapeStringChar | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function getArray() {
return arrayPool.pop() || [];
} | Gets an array from the array pool or creates a new one if the pool is empty.
@private
@returns {Array} The array from the pool. | getArray | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function getObject() {
return objectPool.pop() || {
'array': null,
'cache': null,
'criteria': null,
'false': false,
'index': 0,
'null': false,
'number': null,
'object': null,
'push': null,
'string': null,
'true': false,
'undefined': false,
... | Gets an object from the object pool or creates a new one if the pool is empty.
@private
@returns {Object} The object from the pool. | getObject | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function releaseArray(array) {
array.length = 0;
if (arrayPool.length < maxPoolSize) {
arrayPool.push(array);
}
} | Releases the given array back to the array pool.
@private
@param {Array} [array] The array to release. | releaseArray | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function releaseObject(object) {
var cache = object.cache;
if (cache) {
releaseObject(cache);
}
object.array = object.cache = object.criteria = object.object = object.number = object.string = object.value = null;
if (objectPool.length < maxPoolSize) {
objectPool.push(object);
}
} | Releases the given object back to the object pool.
@private
@param {Object} [object] The object to release. | releaseObject | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function slice(array, start, end) {
start || (start = 0);
if (typeof end == 'undefined') {
end = array ? array.length : 0;
}
var index = -1,
length = end - start || 0,
result = Array(length < 0 ? 0 : length);
while (++index < length) {
result[index] = array[start + index... | Slices the `collection` from the `start` index up to, but not including,
the `end` index.
Note: This function is used instead of `Array#slice` to support node lists
in IE < 9 and to ensure dense arrays are returned.
@private
@param {Array|Object|string} collection The collection to slice.
@param {number} start The st... | slice | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function runInContext(context) {
// Avoid issues with some ES3 environments that attempt to use values, named
// after built-in constructors like `Object`, for the creation of literals.
// ES5 clears this up by stating that literals must use built-in constructors.
// See http://es5.github.io/#x11.1.5.
... | Create a new `lodash` function using the given context object.
@static
@memberOf _
@category Utilities
@param {Object} [context=root] The context object.
@returns {Function} Returns the `lodash` function. | runInContext | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function lodashWrapper(value, chainAll) {
this.__chain__ = !!chainAll;
this.__wrapped__ = value;
} | A fast path for creating `lodash` wrapper objects.
@private
@param {*} value The value to wrap in a `lodash` instance.
@param {boolean} chainAll A flag to enable chaining for all methods
@returns {Object} Returns a `lodash` instance. | lodashWrapper | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function baseBind(bindData) {
var func = bindData[0],
partialArgs = bindData[2],
thisArg = bindData[4];
function bound() {
// `Function#bind` spec
// http://es5.github.io/#x15.3.4.5
if (partialArgs) {
// avoid `arguments` object deoptimizations by using... | The base implementation of `_.bind` that creates the bound function and
sets its meta data.
@private
@param {Array} bindData The bind data array.
@returns {Function} Returns the new bound function. | baseBind | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function bound() {
// `Function#bind` spec
// http://es5.github.io/#x15.3.4.5
if (partialArgs) {
// avoid `arguments` object deoptimizations by using `slice` instead
// of `Array.prototype.slice.call` and not assigning `arguments` to a
// variable as a ternary expre... | The base implementation of `_.bind` that creates the bound function and
sets its meta data.
@private
@param {Array} bindData The bind data array.
@returns {Function} Returns the new bound function. | bound | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function baseClone(value, isDeep, callback, stackA, stackB) {
if (callback) {
var result = callback(value);
if (typeof result != 'undefined') {
return result;
}
}
// inspect [[Class]]
var isObj = isObject(value);
if (isObj) {
var className = toStri... | The base implementation of `_.clone` without argument juggling or support
for `thisArg` binding.
@private
@param {*} value The value to clone.
@param {boolean} [isDeep=false] Specify a deep clone.
@param {Function} [callback] The function to customize cloning values.
@param {Array} [stackA=[]] Tracks traversed source ... | baseClone | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function baseCreate(prototype, properties) {
return isObject(prototype) ? nativeCreate(prototype) : {};
} | The base implementation of `_.create` without support for assigning
properties to the created object.
@private
@param {Object} prototype The object to inherit from.
@returns {Object} Returns the new object. | baseCreate | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function baseCreateCallback(func, thisArg, argCount) {
if (typeof func != 'function') {
return identity;
}
// exit early for no `thisArg` or already bound by `Function#bind`
if (typeof thisArg == 'undefined' || !('prototype' in func)) {
return func;
}
var bindData = f... | The base implementation of `_.createCallback` without support for creating
"_.pluck" or "_.where" style callbacks.
@private
@param {*} [func=identity] The value to convert to a callback.
@param {*} [thisArg] The `this` binding of the created callback.
@param {number} [argCount] The number of arguments the callback acc... | baseCreateCallback | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function baseCreateWrapper(bindData) {
var func = bindData[0],
bitmask = bindData[1],
partialArgs = bindData[2],
partialRightArgs = bindData[3],
thisArg = bindData[4],
arity = bindData[5];
var isBind = bitmask & 1,
isBindKey = bitmask & 2,
... | The base implementation of `createWrapper` that creates the wrapper and
sets its meta data.
@private
@param {Array} bindData The bind data array.
@returns {Function} Returns the new function. | baseCreateWrapper | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function bound() {
var thisBinding = isBind ? thisArg : this;
if (partialArgs) {
var args = slice(partialArgs);
push.apply(args, arguments);
}
if (partialRightArgs || isCurry) {
args || (args = slice(arguments));
if (partialRightArgs) {
... | The base implementation of `createWrapper` that creates the wrapper and
sets its meta data.
@private
@param {Array} bindData The bind data array.
@returns {Function} Returns the new function. | bound | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function baseDifference(array, values) {
var index = -1,
indexOf = getIndexOf(),
length = array ? array.length : 0,
isLarge = length >= largeArraySize && indexOf === baseIndexOf,
result = [];
if (isLarge) {
var cache = createCache(values);
if (cache) ... | The base implementation of `_.difference` that accepts a single array
of values to exclude.
@private
@param {Array} array The array to process.
@param {Array} [values] The array of values to exclude.
@returns {Array} Returns a new array of filtered values. | baseDifference | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function baseFlatten(array, isShallow, isStrict, fromIndex) {
var index = (fromIndex || 0) - 1,
length = array ? array.length : 0,
result = [];
while (++index < length) {
var value = array[index];
if (value && typeof value == 'object' && typeof value.length == 'number'
... | The base implementation of `_.flatten` without support for callback
shorthands or `thisArg` binding.
@private
@param {Array} array The array to flatten.
@param {boolean} [isShallow=false] A flag to restrict flattening to a single level.
@param {boolean} [isStrict=false] A flag to restrict flattening to arrays and `arg... | baseFlatten | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function baseIsEqual(a, b, callback, isWhere, stackA, stackB) {
// used to indicate that when comparing objects, `a` has at least the properties of `b`
if (callback) {
var result = callback(a, b);
if (typeof result != 'undefined') {
return !!result;
}
}
// exit ... | The base implementation of `_.isEqual`, without support for `thisArg` binding,
that allows partial "_.where" style comparisons.
@private
@param {*} a The value to compare.
@param {*} b The other value to compare.
@param {Function} [callback] The function to customize comparing values.
@param {Function} [isWhere=false]... | baseIsEqual | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function baseMerge(object, source, callback, stackA, stackB) {
(isArray(source) ? forEach : forOwn)(source, function(source, key) {
var found,
isArr,
result = source,
value = object[key];
if (source && ((isArr = isArray(source)) || isPlainObject(source))) {
... | The base implementation of `_.merge` without argument juggling or support
for `thisArg` binding.
@private
@param {Object} object The destination object.
@param {Object} source The source object.
@param {Function} [callback] The function to customize merging properties.
@param {Array} [stackA=[]] Tracks traversed sourc... | baseMerge | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function baseRandom(min, max) {
return min + floor(nativeRandom() * (max - min + 1));
} | The base implementation of `_.random` without argument juggling or support
for returning floating-point numbers.
@private
@param {number} min The minimum possible value.
@param {number} max The maximum possible value.
@returns {number} Returns a random number. | baseRandom | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function baseUniq(array, isSorted, callback) {
var index = -1,
indexOf = getIndexOf(),
length = array ? array.length : 0,
result = [];
var isLarge = !isSorted && length >= largeArraySize && indexOf === baseIndexOf,
seen = (callback || isLarge) ? getArray() : result;
... | The base implementation of `_.uniq` without support for callback shorthands
or `thisArg` binding.
@private
@param {Array} array The array to process.
@param {boolean} [isSorted=false] A flag to indicate that `array` is sorted.
@param {Function} [callback] The function called per iteration.
@returns {Array} Returns a d... | baseUniq | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function createAggregator(setter) {
return function(collection, callback, thisArg) {
var result = {};
callback = lodash.createCallback(callback, thisArg, 3);
var index = -1,
length = collection ? collection.length : 0;
if (typeof length == 'number') {
while ... | Creates a function that aggregates a collection, creating an object composed
of keys generated from the results of running each element of the collection
through a callback. The given `setter` function sets the keys and values
of the composed object.
@private
@param {Function} setter The setter function.
@returns {Fun... | createAggregator | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function createWrapper(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) {
var isBind = bitmask & 1,
isBindKey = bitmask & 2,
isCurry = bitmask & 4,
isCurryBound = bitmask & 8,
isPartial = bitmask & 16,
isPartialRight = bitmask & 32;
if (!isBind... | Creates a function that, when called, either curries or invokes `func`
with an 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 method flags to compose.
The bitmask may be composed of the fo... | createWrapper | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function escapeHtmlChar(match) {
return htmlEscapes[match];
} | Used by `escape` to convert characters to HTML entities.
@private
@param {string} match The matched character to escape.
@returns {string} Returns the escaped character. | escapeHtmlChar | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function getIndexOf() {
var result = (result = lodash.indexOf) === indexOf ? baseIndexOf : result;
return result;
} | Gets the appropriate "indexOf" function. If the `_.indexOf` method is
customized, this method returns the custom method, otherwise it returns
the `baseIndexOf` function.
@private
@returns {Function} Returns the "indexOf" function. | getIndexOf | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function isNative(value) {
return typeof value == 'function' && reNative.test(value);
} | Checks if `value` is a native function.
@private
@param {*} value The value to check.
@returns {boolean} Returns `true` if the `value` is a native function, else `false`. | isNative | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function shimIsPlainObject(value) {
var ctor,
result;
// avoid non Object objects, `arguments` objects, and DOM elements
if (!(value && toString.call(value) == objectClass) ||
(ctor = value.constructor, isFunction(ctor) && !(ctor instanceof ctor))) {
return false;
}
... | A fallback implementation of `isPlainObject` which checks if a given value
is an object created by the `Object` constructor, assuming objects created
by the `Object` constructor have no inherited enumerable properties and that
there are no `Object.prototype` extensions.
@private
@param {*} value The value to check.
@r... | shimIsPlainObject | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function unescapeHtmlChar(match) {
return htmlUnescapes[match];
} | Used by `unescape` to convert HTML entities to characters.
@private
@param {string} match The matched character to unescape.
@returns {string} Returns the unescaped character. | unescapeHtmlChar | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function isArguments(value) {
return value && typeof value == 'object' && typeof value.length == 'number' &&
toString.call(value) == argsClass || false;
} | Checks if `value` is an `arguments` object.
@static
@memberOf _
@category Objects
@param {*} value The value to check.
@returns {boolean} Returns `true` if the `value` is an `arguments` object, else `false`.
@example
(function() { return _.isArguments(arguments); })(1, 2, 3);
// => true
_.isArguments([1, 2, 3]);
// ... | isArguments | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
shimKeys = function(object) {
var index, iterable = object, result = [];
if (!iterable) return result;
if (!(objectTypes[typeof object])) return result;
for (index in iterable) {
if (hasOwnProperty.call(iterable, index)) {
result.push(index);
}
}
r... | A fallback implementation of `Object.keys` which produces an array of the
given object's own enumerable property names.
@private
@type Function
@param {Object} object The object to inspect.
@returns {Array} Returns an array of property names. | shimKeys | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
assign = function(object, source, guard) {
var index, iterable = object, result = iterable;
if (!iterable) return result;
var args = arguments,
argsIndex = 0,
argsLength = typeof guard == 'number' ? 2 : args.length;
if (argsLength > 3 && typeof args[argsLength - 2] == 'functi... | Assigns own enumerable properties of source object(s) to the destination
object. Subsequent sources will overwrite property assignments of previous
sources. If a callback is provided it will be executed to produce the
assigned values. The callback is bound to `thisArg` and invoked with two
arguments; (objectValue, sour... | assign | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
function clone(value, isDeep, callback, thisArg) {
// allows working with "Collections" methods without using their `index`
// and `collection` arguments for `isDeep` and `callback`
if (typeof isDeep != 'boolean' && isDeep != null) {
thisArg = callback;
callback = isDeep;
isDee... | Creates a clone of `value`. If `isDeep` is `true` nested objects will also
be cloned, otherwise they will be assigned by reference. If a callback
is provided it will be executed to produce the cloned values. If the
callback returns `undefined` cloning will be handled by the method instead.
The callback is bound to `thi... | clone | javascript | sdelements/lets-chat | media/js/vendor/lodash/lodash.js | https://github.com/sdelements/lets-chat/blob/master/media/js/vendor/lodash/lodash.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.