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 flowRight() {
var funcs = arguments,
fromIndex = funcs.length - 1;
if (fromIndex < 0) {
return function() {};
}
if (!arrayEvery(funcs, isFunction)) {
throw new TypeError(FUNC_ERROR_TEXT);
}
return function() {
var index = fromIndex,
... | This method is like `_.flow` except that it creates a function that
invokes the provided functions from right to left.
@static
@memberOf _
@alias backflow, compose
@category Function
@param {...Function} [funcs] Functions to invoke.
@returns {Function} Returns the new function.
@example
function add(x, y) {
return ... | flowRight | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function negate(predicate) {
if (!isFunction(predicate)) {
throw new TypeError(FUNC_ERROR_TEXT);
}
return function() {
return !predicate.apply(this, arguments);
};
} | Creates a function that negates the result of the predicate `func`. The
`func` predicate is invoked with the `this` binding and arguments of the
created function.
@static
@memberOf _
@category Function
@param {Function} predicate The predicate to negate.
@returns {Function} Returns the new function.
@example
function... | negate | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function partial(func) {
var partials = slice(arguments, 1),
holders = replaceHolders(partials, partial.placeholder);
return createWrapper(func, PARTIAL_FLAG, null, partials, holders);
} | Creates a function that invokes `func` with `partial` arguments prepended
to those provided to the new function. This method is similar to `_.bind`
except it does **not** alter the `this` binding.
**Note:** This method does not set the `length` property of partially
applied functions.
@static
@memberOf _
@category Fu... | partial | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function partialRight(func) {
var partials = slice(arguments, 1),
holders = replaceHolders(partials, partialRight.placeholder);
return createWrapper(func, PARTIAL_RIGHT_FLAG, null, partials, holders);
} | This method is like `_.partial` except that partially applied arguments
are appended to those provided to the new function.
**Note:** This method does not set the `length` property of partially applied
functions.
@static
@memberOf _
@category Function
@param {Function} func The function to partially apply arguments t... | partialRight | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function rearg(func) {
var indexes = baseFlatten(arguments, false, false, 1);
return indexes.length
? createWrapper(func, REARG_FLAG, null, null, null, [indexes])
: createWrapper(func);
} | Creates a function that invokes `func` with arguments arranged according
to the specified indexes where the argument value at the first index is
provided as the first argument, the argument value at the second index is
provided as the second argument, and so on.
@static
@memberOf _
@category Function
@param {Function}... | rearg | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function throttle(func, wait, options) {
var leading = true,
trailing = true;
if (!isFunction(func)) {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (options === false) {
leading = false;
} else if (isObject(options)) {
leading = 'leading' in options ? !!opt... | Creates a function that only invokes `func` at most once per every `wait`
milliseconds. 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 `wait` timeout.
Subsequent calls to the ... | throttle | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function wrap(value, wrapper) {
wrapper = wrapper == null ? identity : wrapper;
return createWrapper(wrapper, PARTIAL_FLAG, null, [value]);
} | Creates a function that provides `value` to the wrapper function as its
first argument. Any additional arguments provided to the function are
appended to those provided to the wrapper function. The wrapper is invoked
with the `this` binding of the created function.
@static
@memberOf _
@category Function
@param {*} val... | wrap | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function clone(value, isDeep, customizer, thisArg) {
// juggle arguments
if (typeof isDeep != 'boolean' && isDeep != null) {
thisArg = customizer;
customizer = isIterateeCall(value, isDeep, thisArg) ? null : isDeep;
isDeep = false;
}
customizer = typeof customizer == 'fun... | Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned,
otherwise they are assigned by reference. If `customizer` is provided it is
invoked to produce the cloned values. If `customizer` returns `undefined`
cloning is handled by the method instead. The `customizer` is bound to
`thisArg` and invoked ... | clone | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function cloneDeep(value, customizer, thisArg) {
customizer = typeof customizer == 'function' && baseCallback(customizer, thisArg, 1);
return baseClone(value, true, customizer);
} | Creates a deep clone of `value`. If `customizer` is provided it is invoked
to produce the cloned values. If `customizer` returns `undefined` cloning
is handled by the method instead. The `customizer` is bound to `thisArg`
and invoked with two argument; (value, index|key).
**Note:** This method is loosely based on the ... | cloneDeep | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isArguments(value) {
var length = (value && typeof value == 'object') ? value.length : undefined;
return (isLength(length) && toString.call(value) == argsClass) || false;
} | Checks if `value` is classified as an `arguments` object.
@static
@memberOf _
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
@example
(function() { return _.isArguments(arguments); })();
// => true
_.isArguments([1, 2, 3]);
// =... | isArguments | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isDate(value) {
return (value && typeof value == 'object' && toString.call(value) == dateClass) || false;
} | Checks if `value` is classified as a `Date` object.
@static
@memberOf _
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
@example
_.isDate(new Date);
// => true
_.isDate('Mon April 23 2012');
// => false | isDate | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isElement(value) {
return (value && typeof value == 'object' && value.nodeType === 1 &&
(lodash.support.nodeClass ? toString.call(value).indexOf('Element') > -1 : isHostObject(value))) || false;
} | Checks if `value` is a DOM element.
@static
@memberOf _
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
@example
_.isElement(document.body);
// => true
_.isElement('<body>');
// => false | isElement | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isEmpty(value) {
if (value == null) {
return true;
}
var length = value.length;
if (isLength(length) && (isArray(value) || isString(value) || isArguments(value) ||
(typeof value == 'object' && isFunction(value.splice)))) {
return !length;
}
return !... | Checks if a collection is empty. A value is considered empty unless it is
an array-like value with a length greater than `0` or an object with own
enumerable properties.
@static
@memberOf _
@category Lang
@param {Array|Object|string} value The value to inspect.
@returns {boolean} Returns `true` if `value` is empty, el... | isEmpty | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isEqual(value, other, customizer, thisArg) {
customizer = typeof customizer == 'function' && baseCallback(customizer, thisArg, 3);
return (!customizer && isStrictComparable(value) && isStrictComparable(other))
? value === other
: baseIsEqual(value, other, customizer);
} | Performs a deep comparison between two values to determine if they are
equivalent. If `customizer` is provided it is invoked to compare values.
If `customizer` returns `undefined` comparisons are handled by the method
instead. The `customizer` is bound to `thisArg` and invoked with three
arguments; (value, other, key).... | isEqual | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isError(value) {
return (value && typeof value == 'object' && toString.call(value) == errorClass) || false;
} | Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
`SyntaxError`, `TypeError`, or `URIError` object.
@static
@memberOf _
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is an error object, else `false`.
@example
_.isError(new Error);
// => tr... | isError | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isFunction(value) {
// Use `|| false` to avoid a Chakra bug in compatibility modes of IE 11.
// See https://github.com/jashkenas/underscore/issues/1621.
return typeof value == 'function' || false;
} | Checks if `value` is classified as a `Function` object.
@static
@memberOf _
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
@example
_.isFunction(_);
// => true
_.isFunction(/abc/);
// => false | isFunction | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isObject(value) {
// Avoid a V8 bug in Chrome 19-20.
// See https://code.google.com/p/v8/issues/detail?id=2291.
var type = typeof value;
return type == 'function' || (value && type == 'object') || false;
} | Checks if `value` is the language type of `Object`.
(e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
**Note:** See the [ES5 spec](http://es5.github.io/#x8) for more details.
@static
@memberOf _
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `v... | isObject | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isNaN(value) {
// `NaN` as a primitive is the only value that is not equal to itself
// (perform the `[[Class]]` check first to avoid errors with some host objects in IE)
return isNumber(value) && value != +value;
} | Checks if `value` is `NaN`.
**Note:** This method is not the same as native `isNaN` which returns `true`
for `undefined` and other non-numeric values. See the [ES5 spec](http://es5.github.io/#x15.1.2.4)
for more details.
@static
@memberOf _
@category Lang
@param {*} value The value to check.
@returns {boolean} Return... | isNaN | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isNative(value) {
if (value == null) {
return false;
}
if (toString.call(value) == funcClass) {
return reNative.test(fnToString.call(value));
}
return (typeof value == 'object' &&
(isHostObject(value) ? reNative : reHostCtor).test(value)) || false;
} | Checks if `value` is a native function.
@static
@memberOf _
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is a native function, else `false`.
@example
_.isNative(Array.prototype.push);
// => true
_.isNative(_);
// => false | isNative | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isNull(value) {
return value === null;
} | Checks if `value` is `null`.
@static
@memberOf _
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is `null`, else `false`.
@example
_.isNull(null);
// => true
_.isNull(void 0);
// => false | isNull | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isRegExp(value) {
return (isObject(value) && toString.call(value) == regexpClass) || false;
} | Checks if `value` is classified as a `RegExp` object.
@static
@memberOf _
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
@example
_.isRegExp(/abc/);
// => true
_.isRegExp('/abc/');
// => false | isRegExp | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isUndefined(value) {
return typeof value == 'undefined';
} | Checks if `value` is `undefined`.
@static
@memberOf _
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
@example
_.isUndefined(void 0);
// => true
_.isUndefined(null);
// => false | isUndefined | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function create(prototype, properties, guard) {
var result = baseCreate(prototype);
properties = guard ? null : properties;
return properties ? baseAssign(result, properties) : result;
} | Creates an object that inherits from the given `prototype` object. If a
`properties` object is provided its own enumerable properties are assigned
to the created object.
@static
@memberOf _
@category Object
@param {Object} prototype The object to inherit from.
@param {Object} [properties] The properties to assign to t... | create | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function defaults(object) {
if (object == null) {
return object;
}
var args = baseSlice(arguments);
args.push(assignDefaults);
return assign.apply(undefined, args);
} | Assigns own enumerable properties of source object(s) to the destination
object for all destination properties that resolve to `undefined`. Once a
property is set, additional defaults of the same property are ignored.
**Note:** See the [documentation example of `_.partialRight`](http://lodash.com/docs#partialRight)
fo... | defaults | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function findKey(object, predicate, thisArg) {
predicate = getCallback(predicate, thisArg, 3);
return baseFind(object, predicate, baseForOwn, true);
} | This method is like `_.findIndex` except that it returns the key 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 `predic... | findKey | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function findLastKey(object, predicate, thisArg) {
predicate = getCallback(predicate, thisArg, 3);
return baseFind(object, predicate, baseForOwnRight, true);
} | This method is like `_.findKey` except that it iterates over elements of
a collection in the opposite order.
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 callbac... | findLastKey | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function forIn(object, iteratee, thisArg) {
if (typeof iteratee != 'function' || typeof thisArg != 'undefined') {
iteratee = baseCallback(iteratee, thisArg, 3);
}
return baseFor(object, iteratee, keysIn);
} | Iterates over own and inherited enumerable properties of an object invoking
`iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked
with three arguments; (value, key, object). Iterator functions may exit
iteration early by explicitly returning `false`.
@static
@memberOf _
@category Object
@param... | forIn | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function forInRight(object, iteratee, thisArg) {
iteratee = baseCallback(iteratee, thisArg, 3);
return baseForRight(object, iteratee, keysIn);
} | This method is like `_.forIn` except that it iterates over properties of
`object` in the opposite order.
@static
@memberOf _
@category Object
@param {Object} object The object to iterate over.
@param {Function} [iteratee=_.identity] The function invoked per iteration.
@param {*} [thisArg] The `this` binding of `iterat... | forInRight | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function forOwn(object, iteratee, thisArg) {
if (typeof iteratee != 'function' || typeof thisArg != 'undefined') {
iteratee = baseCallback(iteratee, thisArg, 3);
}
return baseForOwn(object, iteratee);
} | Iterates over own enumerable properties of an object invoking `iteratee`
for each property. The `iteratee` is bound to `thisArg` and invoked with
three arguments; (value, key, object). Iterator functions may exit iteration
early by explicitly returning `false`.
@static
@memberOf _
@category Object
@param {Object} obje... | forOwn | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function forOwnRight(object, iteratee, thisArg) {
iteratee = baseCallback(iteratee, thisArg, 3);
return baseForRight(object, iteratee, keys);
} | This method is like `_.forOwn` except that it iterates over properties of
`object` in the opposite order.
@static
@memberOf _
@category Object
@param {Object} object The object to iterate over.
@param {Function} [iteratee=_.identity] The function invoked per iteration.
@param {*} [thisArg] The `this` binding of `itera... | forOwnRight | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function functions(object) {
return baseFunctions(object, keysIn(object));
} | Creates an array of function property names from all enumerable properties,
own and inherited, of `object`.
@static
@memberOf _
@alias methods
@category Object
@param {Object} object The object to inspect.
@returns {Array} Returns the new array of property names.
@example
_.functions(_);
// => ['all', 'any', 'bind', ... | functions | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function has(object, key) {
return object ? hasOwnProperty.call(object, key) : false;
} | Checks if the specified property name exists as a direct property of `object`,
instead of an inherited property.
@static
@memberOf _
@category Object
@param {Object} object The object to inspect.
@param {string} key The name of the property to check.
@returns {boolean} Returns `true` if `key` is a direct property, els... | has | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function invert(object, multiValue, guard) {
multiValue = guard ? null : multiValue;
var index = -1,
props = keys(object),
length = props.length,
result = {};
while (++index < length) {
var key = props[index],
value = object[key];
if (multiV... | Creates an object composed of the inverted keys and values of `object`.
If `object` contains duplicate values, subsequent values overwrite property
assignments of previous values unless `multiValue` is `true`.
@static
@memberOf _
@category Object
@param {Object} object The object to invert.
@param {boolean} [multiValu... | invert | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function keysIn(object) {
if (object == null) {
return [];
}
if (!isObject(object)) {
object = Object(object);
}
var length = object.length,
support = lodash.support;
length = (typeof length == 'number' && length > 0 &&
(isArray(object) || (support.... | Creates an array of the own and inherited enumerable property names of `object`.
@static
@memberOf _
@category Object
@param {Object} object The object to inspect.
@returns {Array} Returns the array of property names.
@example
function Shape() {
this.x = 0;
this.y = 0;
}
Shape.prototype.z = 0;
_.keysIn(new Shap... | keysIn | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function mapValues(object, iteratee, thisArg) {
iteratee = getCallback(iteratee, thisArg, 3);
var result = {}
baseForOwn(object, function(value, key, object) {
result[key] = iteratee(value, key, object);
});
return result;
} | Creates an object with the same keys as `object` and values generated by
running each own enumerable property of `object` through `iteratee`. The
iteratee function is bound to `thisArg` and invoked with three arguments;
(value, key, object).
If a property name is provided for `iteratee` the created "_.pluck" style
cal... | mapValues | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function pairs(object) {
var index = -1,
props = keys(object),
length = props.length,
result = Array(length);
while (++index < length) {
var key = props[index];
result[index] = [key, object[key]];
}
return result;
} | Creates a two dimensional array of the key-value pairs for `object`,
e.g. `[[key1, value1], [key2, value2]]`.
@static
@memberOf _
@category Object
@param {Object} object The object to inspect.
@returns {Array} Returns the new array of key-value pairs.
@example
_.pairs({ 'barney': 36, 'fred': 40 });
// => [['barney', ... | pairs | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function pick(object, predicate, thisArg) {
if (object == null) {
return {};
}
return typeof predicate == 'function'
? pickByCallback(object, getCallback(predicate, thisArg, 3))
: pickByArray(object, baseFlatten(arguments, false, false, 1));
} | Creates a shallow clone of `object` composed of the specified properties.
Property names may be specified as individual arguments or as arrays of
property names. If `predicate` is provided it is invoked for each property
of `object` picking the properties `predicate` returns truthy for. The
predicate is bound to `thisA... | pick | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function transform(object, iteratee, accumulator, thisArg) {
iteratee = getCallback(iteratee, thisArg, 4);
var isArr = isArrayLike(object);
if (accumulator == null) {
if (isArr || isObject(object)) {
var Ctor = object.constructor;
if (isArr) {
accumulator = isA... | An alternative to `_.reduce`; this method transforms `object` to a new
`accumulator` object which is the result of running each of its own
enumerable properties through `iteratee`, with each invocation potentially
mutating the `accumulator` object. The `iteratee` is bound to `thisArg`
and invoked with four arguments; (... | transform | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function values(object) {
return baseValues(object, keys);
} | Creates an array of the own enumerable property values of `object`.
@static
@memberOf _
@category Object
@param {Object} object The object to inspect.
@returns {Array} Returns the array of property values.
@example
function Shape(x, y) {
this.x = x;
this.y = y;
}
Shape.prototype.z = 0;
_.values(new Shape(2, 1))... | values | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function valuesIn(object) {
return baseValues(object, keysIn);
} | Creates an array of the own and inherited enumerable property values
of `object`.
@static
@memberOf _
@category Object
@param {Object} object The object to inspect.
@returns {Array} Returns the array of property values.
@example
function Shape(x, y) {
this.x = x;
this.y = y;
}
Shape.prototype.z = 0;
_.valuesIn(... | valuesIn | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function capitalize(string) {
string = string == null ? '' : String(string);
return string ? (string.charAt(0).toUpperCase() + string.slice(1)) : string;
} | Capitalizes the first character of `string`.
@static
@memberOf _
@category String
@param {string} [string=''] The string to capitalize.
@returns {string} Returns the capitalized string.
@example
_.capitalize('fred');
// => 'Fred' | capitalize | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function endsWith(string, target, position) {
string = string == null ? '' : String(string);
target = String(target);
var length = string.length;
position = (typeof position == 'undefined' ? length : nativeMin(position < 0 ? 0 : (+position || 0), length)) - target.length;
return position ... | Checks if `string` ends with the given target string.
@static
@memberOf _
@category String
@param {string} [string=''] The string to search.
@param {string} [target] The string to search for.
@param {number} [position=string.length] The position to search from.
@returns {boolean} Returns `true` if `string` ends with `... | endsWith | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function escape(string) {
// reset `lastIndex` because in IE < 9 `String#replace` does not
string = string == null ? '' : String(string);
return string && (reUnescapedHtml.lastIndex = 0, reUnescapedHtml.test(string))
? string.replace(reUnescapedHtml, escapeHtmlChar)
: string;
} | Converts the characters "&", "<", ">", '"', "'", and '`', in `string` to
their corresponding HTML entities.
**Note:** No other characters are escaped. To escape additional characters
use a third-party library like [_he_](http://mths.be/he).
When working with HTML you should always quote attribute values to reduce
XSS... | escape | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function escapeRegExp(string) {
string = string == null ? '' : String(string);
return string && (reRegExpChars.lastIndex = 0, reRegExpChars.test(string))
? string.replace(reRegExpChars, '\\$&')
: string;
} | Escapes the `RegExp` special characters "\", "^", "$", ".", "|", "?", "*",
"+", "(", ")", "[", "]", "{" and "}" in `string`.
@static
@memberOf _
@category String
@param {string} [string=''] The string to escape.
@returns {string} Returns the escaped string.
@example
_.escapeRegExp('[lodash](http://lodash.com/)');
// ... | escapeRegExp | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function pad(string, length, chars) {
string = string == null ? '' : String(string);
length = +length;
var strLength = string.length;
if (strLength >= length || !nativeIsFinite(length)) {
return string;
}
var mid = (length - strLength) / 2,
leftLength = floor(mid),... | Pads `string` on the left and right sides if it is shorter then the given
padding length. The `chars` string may be truncated if the number of padding
characters can't be evenly divided by the padding length.
@static
@memberOf _
@category String
@param {string} [string=''] The string to pad.
@param {number} [length=0]... | pad | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function padLeft(string, length, chars) {
string = string == null ? '' : String(string);
return string ? (createPad(string, length, chars) + string) : string;
} | Pads `string` on the left side if it is shorter then the given padding
length. The `chars` string may be truncated if the number of padding
characters exceeds the padding length.
@static
@memberOf _
@category String
@param {string} [string=''] The string to pad.
@param {number} [length=0] The padding length.
@param {s... | padLeft | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function padRight(string, length, chars) {
string = string == null ? '' : String(string);
return string ? (string + createPad(string, length, chars)) : string;
} | Pads `string` on the right side if it is shorter then the given padding
length. The `chars` string may be truncated if the number of padding
characters exceeds the padding length.
@static
@memberOf _
@category String
@param {string} [string=''] The string to pad.
@param {number} [length=0] The padding length.
@param {... | padRight | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function repeat(string, n) {
var result = '';
n = +n;
if (n < 1 || string == null || !nativeIsFinite(n)) {
return result;
}
string = String(string);
// leverage the exponentiation by squaring algorithm for a faster repeat
// http://en.wikipedia.org/wiki/Exponentiation... | Repeats the given string `n` times.
@static
@memberOf _
@category String
@param {string} [string=''] The string to repeat.
@param {number} [n=0] The number of times to repeat the string.
@returns {string} Returns the repeated string.
@example
_.repeat('*', 3);
// => '***'
_.repeat('abc', 2);
// => 'abcabc'
_.repeat... | repeat | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function startsWith(string, target, position) {
string = string == null ? '' : String(string);
position = typeof position == 'undefined' ? 0 : nativeMin(position < 0 ? 0 : (+position || 0), string.length);
return string.lastIndexOf(target, position) == position;
} | Checks if `string` starts with the given target string.
@static
@memberOf _
@category String
@param {string} [string=''] The string to search.
@param {string} [target] The string to search for.
@param {number} [position=0] The position to search from.
@returns {boolean} Returns `true` if `string` starts with `target`,... | startsWith | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function trim(string, chars, guard) {
string = string == null ? '' : String(string);
if (!string) {
return string;
}
if (guard || chars == null) {
return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1);
}
chars = String(chars);
return strin... | Removes leading and trailing whitespace or specified characters from `string`.
@static
@memberOf _
@category String
@param {string} [string=''] The string to trim.
@param {string} [chars=whitespace] The characters to trim.
@param- {Object} [guard] Enables use as a callback for functions like `_.map`.
@returns {string}... | trim | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function trimLeft(string, chars, guards) {
string = string == null ? '' : String(string);
if (!string) {
return string;
}
if (guards || chars == null) {
return string.slice(trimmedLeftIndex(string))
}
chars = String(chars);
return string.slice(charsLeftIndex(str... | Removes leading whitespace or specified characters from `string`.
@static
@memberOf _
@category String
@param {string} [string=''] The string to trim.
@param {string} [chars=whitespace] The characters to trim.
@param- {Object} [guard] Enables use as a callback for functions like `_.map`.
@returns {string} Returns the ... | trimLeft | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function trimRight(string, chars, guard) {
string = string == null ? '' : String(string);
if (!string) {
return string;
}
if (guard || chars == null) {
return string.slice(0, trimmedRightIndex(string) + 1)
}
chars = String(chars);
return string.slice(0, charsRig... | Removes trailing whitespace or specified characters from `string`.
@static
@memberOf _
@category String
@param {string} [string=''] The string to trim.
@param {string} [chars=whitespace] The characters to trim.
@param- {Object} [guard] Enables use as a callback for functions like `_.map`.
@returns {string} Returns the... | trimRight | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function unescape(string) {
string = string == null ? '' : String(string);
return string && (reEscapedHtml.lastIndex = 0, reEscapedHtml.test(string))
? string.replace(reEscapedHtml, unescapeHtmlChar)
: string;
} | The inverse of `_.escape`; this method converts the HTML entities
`&`, `<`, `>`, `"`, `'`, and ``` in `string` to their
corresponding characters.
**Note:** No other HTML entities are unescaped. To unescape additional HTML
entities use a third-party library like [_he_](http://mths.be/he).
@stati... | unescape | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function words(string, pattern, guard) {
string = string != null && String(string);
pattern = guard ? null : pattern;
return (string && string.match(pattern || reWords)) || [];
} | Splits `string` into an array of its words.
@static
@memberOf _
@category String
@param {string} [string=''] The string to inspect.
@param {RegExp|string} [pattern] The pattern to match words.
@param- {Object} [guard] Enables use as a callback for functions like `_.map`.
@returns {Array} Returns the words of `string`.... | words | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function attempt(func) {
try {
return func();
} catch(e) {
return isError(e) ? e : Error(e);
}
} | Attempts to invoke `func`, returning either the result or the caught
error object.
@static
@memberOf _
@category Utility
@param {*} func The function to attempt.
@returns {*} Returns the `func` result or error object.
@example
// avoid throwing errors for invalid selectors
var elements = _.attempt(function() {
retu... | attempt | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function callback(func, thisArg, guard) {
return baseCallback(func, guard ? undefined : thisArg);
} | Creates a function bound to an optional `thisArg`. If `func` is a property
name the created callback returns the property value for a given element.
If `func` is an object the created callback returns `true` for elements
that contain the equivalent object properties, otherwise it returns `false`.
@static
@memberOf _
@... | callback | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function constant(value) {
return function() {
return value;
};
} | Creates a function that returns `value`.
@static
@memberOf _
@category Utility
@param {*} value The value to return from the new function.
@returns {Function} Returns the new function.
@example
var object = { 'user': 'fred' };
var getter = _.constant(object);
getter() === object;
// => true | constant | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function identity(value) {
return value;
} | This method returns the first argument provided to it.
@static
@memberOf _
@category Utility
@param {*} value Any value.
@returns {*} Returns `value`.
@example
var object = { 'user': 'fred' };
_.identity(object) === object;
// => true | identity | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function matches(source) {
var props = keys(source),
length = props.length;
if (length == 1) {
var key = props[0],
value = source[key];
if (isStrictComparable(value)) {
return function(object) {
return object != null && value === object[key] && h... | Creates a "_.where" style predicate function which performs a deep comparison
between a given object and the `source` object, returning `true` if the given
object has equivalent property values, else `false`.
@static
@memberOf _
@category Utility
@param {Object} source The object of property values to match.
@returns ... | matches | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function mixin(object, source, options) {
var chain = true,
isObj = isObject(source),
noOpts = options == null,
props = noOpts && isObj && keys(source),
methodNames = props && baseFunctions(source, props);
if ((props && props.length && !methodNames.length) || (noOpts... | Adds all own enumerable function properties of a source object to the
destination object. If `object` is a function then methods are added to
its prototype as well.
@static
@memberOf _
@category Utility
@param {Function|Object} [object=this] object The destination object.
@param {Object} source The object of functions... | mixin | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.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 Utility
@returns {Function} Returns the `lodash` function.
@example
var lodash = _.noConflict(); | noConflict | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function noop() {
// no operation performed
} | A no-operation function.
@static
@memberOf _
@category Utility
@example
var object = { 'user': 'fred' };
_.noop(object) === undefined;
// => true | noop | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function parseInt(value, radix, guard) {
return nativeParseInt(value, guard ? 0 : radix);
} | Converts `value` to an integer of the specified radix. If `radix` is
`undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal,
in which case a `radix` of `16` is used.
**Note:** This method aligns with the ES5 implementation of `parseInt`.
See the [ES5 spec](http://es5.github.io/#E) for more detai... | parseInt | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function property(key) {
key = String(key);
return function(object) {
return object == null ? undefined : object[key];
};
} | Creates a "_.pluck" style function which returns the property value
of `key` on a given object.
@static
@memberOf _
@category Utility
@param {string} key The name of the property to retrieve.
@returns {Function} Returns the new function.
@example
var users = [
{ 'user': 'fred', 'age': 40 },
{ 'user': 'barney', ... | property | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function propertyOf(object) {
return function(key) {
return object == null ? undefined : object[key];
};
} | The inverse of `_.property`; this method creates a function which returns
the property value of a given key on `object`.
@static
@memberOf _
@category Utility
@param {Object} object The object to inspect.
@returns {Function} Returns the new function.
@example
var fred = { 'user': 'fred', 'age': 40, 'active': true };
... | propertyOf | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function random(min, max, floating) {
if (floating && isIterateeCall(min, max, floating)) {
max = floating = null;
}
var noMin = min == null,
noMax = max == null;
if (floating == null) {
if (noMax && typeof min == 'boolean') {
floating = min;
min = ... | Produces a random number between `min` and `max` (inclusive). If only one
argument is provided a number between `0` and the given number is returned.
If `floating` is `true`, or either `min` or `max` are floats, a floating-point
number is returned instead of an integer.
@static
@memberOf _
@category Utility
@param {nu... | random | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function range(start, end, step) {
if (step && isIterateeCall(start, end, step)) {
end = step = null;
}
start = +start || 0;
step = step == null ? 1 : (+step || 0);
if (end == null) {
end = start;
start = 0;
} else {
end = +end || 0;
}
// ... | Creates an array of numbers (positive and/or negative) progressing from
`start` up to, but not including, `end`. If `start` is less than `end` a
zero-length range is created unless a negative `step` is specified.
@static
@memberOf _
@category Utility
@param {number} [start=0] The start of the range.
@param {number} en... | range | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function result(object, key, defaultValue) {
var value = object == null ? undefined : object[key];
if (typeof value == 'undefined') {
return defaultValue;
}
return isFunction(value) ? object[key]() : value;
} | Resolves the value of property `key` on `object`. If `key` is a function
it is invoked with the `this` binding of `object` and its result returned,
else the property value is returned. If `object` is `null` or `undefined`
then `undefined` is returned. If a default value is provided it is returned
if the property value ... | result | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function times(n, iteratee, thisArg) {
n = nativeIsFinite(n = +n) && n > -1 ? n : 0;
iteratee = baseCallback(iteratee, thisArg, 1);
var index = -1,
result = Array(nativeMin(n, MAX_ARRAY_LENGTH));
while (++index < n) {
if (index < MAX_ARRAY_LENGTH) {
result[index] = ... | Invokes the iteratee function `n` times, returning an array of the results
of each invocation. The `iteratee` is bound to `thisArg` and invoked with
one argument; (index).
@static
@memberOf _
@category Utility
@param {number} n The number of times to invoke `iteratee`.
@param {Function} [iteratee=_.identity] The funct... | times | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function uniqueId(prefix) {
var id = ++idCounter;
return String(prefix == null ? '' : prefix) + id;
} | Generates a unique ID. If `prefix` is provided the ID is appended to it.
@static
@memberOf _
@category Utility
@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 | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
_ = function(obj) {
if (obj instanceof _) return obj;
if (!(this instanceof _)) return new _(obj);
this._wrapped = obj;
} | The semantic version number.
@static
@memberOf _
@type string | _ | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
optimizeCb = function(func, context, argCount) {
if (context === void 0) return func;
switch (argCount == null ? 3 : argCount) {
case 1: return function(value) {
return func.call(context, value);
};
case 2: return function(value, other) {
return func.call(context, value, other)... | The semantic version number.
@static
@memberOf _
@type string | optimizeCb | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
cb = function(value, context, argCount) {
if (value == null) return _.identity;
if (_.isFunction(value)) return optimizeCb(value, context, argCount);
if (_.isObject(value)) return _.matches(value);
return _.property(value);
} | The semantic version number.
@static
@memberOf _
@type string | cb | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
group = function(behavior) {
return function(obj, iteratee, context) {
var result = {};
iteratee = cb(iteratee, context);
_.each(obj, function(value, index) {
var key = iteratee(value, index, obj);
behavior(result, value, key);
});
return result;
};
} | The semantic version number.
@static
@memberOf _
@type string | group | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
flatten = function(input, shallow, strict, startIndex) {
var output = [], idx = 0, value;
for (var i = startIndex || 0, length = input && input.length; i < length; i++) {
value = input[i];
if (value && value.length >= 0 && (_.isArray(value) || _.isArguments(value))) {
//flatten current level... | The semantic version number.
@static
@memberOf _
@type string | flatten | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {
if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
Ctor.prototype = sourceFunc.prototype;
var self = new Ctor;
Ctor.prototype = null;
var result = sourceFunc.apply(self, args);
if (_.... | The semantic version number.
@static
@memberOf _
@type string | executeBound | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
memoize = function(key) {
var cache = memoize.cache;
var address = '' + (hasher ? hasher.apply(this, arguments) : key);
if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);
return cache[address];
} | The semantic version number.
@static
@memberOf _
@type string | memoize | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
later = function() {
previous = options.leading === false ? 0 : _.now();
timeout = null;
result = func.apply(context, args);
if (!timeout) context = args = null;
} | The semantic version number.
@static
@memberOf _
@type string | later | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
later = function() {
var last = _.now() - timestamp;
if (last < wait && last >= 0) {
timeout = setTimeout(later, wait - last);
} else {
timeout = null;
if (!immediate) {
result = func.apply(context, args);
if (!timeout) context = args = null;
}
... | The semantic version number.
@static
@memberOf _
@type string | later | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function collectNonEnumProps(obj, keys) {
var nonEnumIdx = nonEnumerableProps.length;
var proto = typeof obj.constructor === 'function' ? FuncProto : ObjProto;
while (nonEnumIdx--) {
var prop = nonEnumerableProps[nonEnumIdx];
if (prop === 'constructor' ? _.has(obj, prop) : prop in obj &&
... | The semantic version number.
@static
@memberOf _
@type string | collectNonEnumProps | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
eq = function(a, b, aStack, bStack) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
if (a === b) return a !== 0 || 1 / a === 1 / b;
// A strict comparison is necessary because `null == und... | The semantic version number.
@static
@memberOf _
@type string | eq | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
createEscaper = function(map) {
var escaper = function(match) {
return map[match];
};
// Regexes for identifying a key that needs to be escaped
var source = '(?:' + _.keys(map).join('|') + ')';
var testRegexp = RegExp(source);
var replaceRegexp = RegExp(source, 'g');
return function(st... | The semantic version number.
@static
@memberOf _
@type string | createEscaper | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
escaper = function(match) {
return map[match];
} | The semantic version number.
@static
@memberOf _
@type string | escaper | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
escapeChar = function(match) {
return '\\' + escapes[match];
} | The semantic version number.
@static
@memberOf _
@type string | escapeChar | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
template = function(data) {
return render.call(this, data, _);
} | The semantic version number.
@static
@memberOf _
@type string | template | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
result = function(instance, obj) {
return instance._chain ? _(obj).chain() : obj;
} | The semantic version number.
@static
@memberOf _
@type string | result | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function bindInternal_0_0_1 (func, thisContext, numArgs) {
switch (numArgs) {
case 3: return function(a, b, c) {
return func.call(thisContext, a, b, c);
};
case 4: return function(a, b, c, d) {
return func.call(thisContext, a, b, c, d);
};
}
return function() {
return func.apply(th... | Intern a string to make comparisons faster.
> Note: This is a relatively expensive operation, you
shouldn't usually do the actual interning at runtime, instead
use this at compile time to make future work faster.
@param {String} string The string to intern.
@return {String} The interned string. | bindInternal_0_0_1 | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function bindInternal3_0_0_2a (func, thisContext) {
return function (a, b, c) {
return func.call(thisContext, a, b, c);
};
} | Intern a string to make comparisons faster.
> Note: This is a relatively expensive operation, you
shouldn't usually do the actual interning at runtime, instead
use this at compile time to make future work faster.
@param {String} string The string to intern.
@return {String} The interned string. | bindInternal3_0_0_2a | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function bindInternal4_0_0_2a (func, thisContext) {
return function (a, b, c, d) {
return func.call(thisContext, a, b, c, d);
};
} | Intern a string to make comparisons faster.
> Note: This is a relatively expensive operation, you
shouldn't usually do the actual interning at runtime, instead
use this at compile time to make future work faster.
@param {String} string The string to intern.
@return {String} The interned string. | bindInternal4_0_0_2a | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function Fast (value) {
if (!(this instanceof Fast)) {
return new Fast(value);
}
this.value = value || [];
} | # Constructor
Provided as a convenient wrapper around Fast functions.
```js
var arr = fast([1,2,3,4,5,6]);
var result = arr.filter(function (item) {
return item % 2 === 0;
});
result instanceof Fast; // true
result.length; // 3
```
@param {Array} value The value to wrap. | Fast | javascript | codemix/fast.js | dist/fast.js | https://github.com/codemix/fast.js/blob/master/dist/fast.js | MIT |
function addActiveClass($target) {
if (!$target) {
return;
}
$target.find('button').addClass('active');
$selectedNode = $target;
} | show image dialog
@param {jQuery} $dialog
@return {Promise} | addActiveClass | javascript | summernote/summernote | public/plugin/specialchars/summernote-ext-specialchars.js | https://github.com/summernote/summernote/blob/master/public/plugin/specialchars/summernote-ext-specialchars.js | MIT |
function removeActiveClass($target) {
$target.find('button').removeClass('active');
$selectedNode = null;
} | show image dialog
@param {jQuery} $dialog
@return {Promise} | removeActiveClass | javascript | summernote/summernote | public/plugin/specialchars/summernote-ext-specialchars.js | https://github.com/summernote/summernote/blob/master/public/plugin/specialchars/summernote-ext-specialchars.js | MIT |
function findNextNode(row, column) {
var findNode = null;
$.each($specialCharNode, function(idx, $node) {
var findRow = Math.ceil((idx + 1) / COLUMN_LENGTH);
var findColumn = ((idx + 1) % COLUMN_LENGTH === 0) ? COLUMN_LENGTH : (idx + 1) % COLUMN_LENGTH;
... | show image dialog
@param {jQuery} $dialog
@return {Promise} | findNextNode | javascript | summernote/summernote | public/plugin/specialchars/summernote-ext-specialchars.js | https://github.com/summernote/summernote/blob/master/public/plugin/specialchars/summernote-ext-specialchars.js | MIT |
function arrowKeyHandler(keyCode) {
// left, right, up, down key
var $nextNode;
var lastRowColumnLength = $specialCharNode.length % totalColumn;
if (KEY.LEFT === keyCode) {
if (currentColumn > 1) {
currentColumn = currentColumn - 1;
... | show image dialog
@param {jQuery} $dialog
@return {Promise} | arrowKeyHandler | javascript | summernote/summernote | public/plugin/specialchars/summernote-ext-specialchars.js | https://github.com/summernote/summernote/blob/master/public/plugin/specialchars/summernote-ext-specialchars.js | MIT |
function enterKeyHandler() {
if (!$selectedNode) {
return;
}
deferred.resolve(decodeURIComponent($selectedNode.find('button').attr('data-value')));
$specialCharDialog.modal('hide');
} | show image dialog
@param {jQuery} $dialog
@return {Promise} | enterKeyHandler | javascript | summernote/summernote | public/plugin/specialchars/summernote-ext-specialchars.js | https://github.com/summernote/summernote/blob/master/public/plugin/specialchars/summernote-ext-specialchars.js | MIT |
function keyDownEventHandler(event) {
event.preventDefault();
var keyCode = event.keyCode;
if (keyCode === undefined || keyCode === null) {
return;
}
// check arrowKeys match
if (ARROW_KEYS.indexOf(keyCode) > -1) {
if ($... | show image dialog
@param {jQuery} $dialog
@return {Promise} | keyDownEventHandler | javascript | summernote/summernote | public/plugin/specialchars/summernote-ext-specialchars.js | https://github.com/summernote/summernote/blob/master/public/plugin/specialchars/summernote-ext-specialchars.js | MIT |
constructor($note, options) {
this.$note = $note;
this.memos = {};
this.modules = {};
this.layoutInfo = {};
this.options = $.extend(true, {}, options);
// init ui with options
$.summernote.ui = $.summernote.ui_template(this.options);
this.ui = $.summernote.ui;
this.initialize();
... | @param {jQuery} $note
@param {Object} options | constructor | javascript | summernote/summernote | src/js/Context.js | https://github.com/summernote/summernote/blob/master/src/js/Context.js | MIT |
initialize() {
this.layoutInfo = this.ui.createLayout(this.$note);
this._initialize();
this.$note.hide();
return this;
} | create layout and initialize modules and other resources | initialize | javascript | summernote/summernote | src/js/Context.js | https://github.com/summernote/summernote/blob/master/src/js/Context.js | MIT |
destroy() {
this._destroy();
this.$note.removeData('summernote');
this.ui.removeLayout(this.$note, this.layoutInfo);
} | destroy modules and other resources and remove layout | destroy | javascript | summernote/summernote | src/js/Context.js | https://github.com/summernote/summernote/blob/master/src/js/Context.js | MIT |
reset() {
const disabled = this.isDisabled();
this.code(dom.emptyPara);
this._destroy();
this._initialize();
if (disabled) {
this.disable();
}
} | destory modules and other resources and initialize it again | reset | javascript | summernote/summernote | src/js/Context.js | https://github.com/summernote/summernote/blob/master/src/js/Context.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.