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 runSuite(options) {
var me = this;
me.reset();
me.running = true;
options || (options = {});
invoke(me, {
'name': 'run',
'args': options,
'queued': options.queued,
'onStart': function(event) {
me.emit(event);
},
'onCycle': function(event) {
... | Runs the suite.
@name run
@memberOf Benchmark.Suite
@param {Object} [options={}] Options object.
@returns {Object} The suite instance.
@example
// basic usage
suite.run();
// or with options
suite.run({ 'async': true, 'queued': true }); | runSuite | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function emit(type) {
var listeners,
me = this,
event = Event(type),
events = me.events,
args = (arguments[0] = event, arguments);
event.currentTarget || (event.currentTarget = me);
event.target || (event.target = me);
delete event.result;
if (events && (listeners =... | Executes all registered listeners of the specified event type.
@memberOf Benchmark, Benchmark.Suite
@param {String|Object} type The event type or object.
@returns {Mixed} Returns the return value of the last listener executed. | emit | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function listeners(type) {
var me = this,
events = me.events || (me.events = {});
return hasKey(events, type) ? events[type] : (events[type] = []);
} | Returns an array of event listeners for a given type that can be manipulated
to add or remove listeners.
@memberOf Benchmark, Benchmark.Suite
@param {String} type The event type.
@returns {Array} The listeners array. | listeners | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function off(type, listener) {
var me = this,
events = me.events;
events && each(type ? type.split(' ') : events, function(listeners, type) {
var index;
if (typeof listeners == 'string') {
type = listeners;
listeners = hasKey(events, type) && events[type];
}
if (... | Unregisters a listener for the specified event type(s),
or unregisters all listeners for the specified event type(s),
or unregisters all listeners for all event types.
@memberOf Benchmark, Benchmark.Suite
@param {String} [type] The event type.
@param {Function} [listener] The function to unregister.
@returns {Object} ... | off | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function on(type, listener) {
var me = this,
events = me.events || (me.events = {});
forEach(type.split(' '), function(type) {
(hasKey(events, type)
? events[type]
: (events[type] = [])
).push(listener);
});
return me;
} | Registers a listener for the specified event type(s).
@memberOf Benchmark, Benchmark.Suite
@param {String} type The event type.
@param {Function} listener The function to register.
@returns {Object} The benchmark instance.
@example
// register a listener for an event type
bench.on('cycle', listener);
// register a l... | on | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function abort() {
var event,
me = this,
resetting = calledBy.reset;
if (me.running) {
event = Event('abort');
me.emit(event);
if (!event.cancelled || resetting) {
// avoid infinite recursion
calledBy.abort = true;
me.reset();
delete calledBy.ab... | Aborts the benchmark without recording times.
@memberOf Benchmark
@returns {Object} The benchmark instance. | abort | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function clone(options) {
var me = this,
result = new me.constructor(extend({}, me, options));
// correct the `options` object
result.options = extend({}, me.options, options);
// copy own custom properties
forOwn(me, function(value, key) {
if (!hasKey(result, key)) {
result[... | Creates a new benchmark using the same test and options.
@memberOf Benchmark
@param {Object} options Options object to overwrite cloned options.
@returns {Object} The new benchmark instance.
@example
var bizarro = bench.clone({
'name': 'doppelganger'
}); | clone | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function compare(other) {
var critical,
zStat,
me = this,
sample1 = me.stats.sample,
sample2 = other.stats.sample,
size1 = sample1.length,
size2 = sample2.length,
maxSize = max(size1, size2),
minSize = min(size1, size2),
u1 = getU(sample1, samp... | Determines if a benchmark is faster than another.
@memberOf Benchmark
@param {Object} other The benchmark to compare.
@returns {Number} Returns `-1` if slower, `1` if faster, and `0` if indeterminate. | compare | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function getScore(xA, sampleB) {
return reduce(sampleB, function(total, xB) {
return total + (xB > xA ? 0 : xB < xA ? 1 : 0.5);
}, 0);
} | Determines if a benchmark is faster than another.
@memberOf Benchmark
@param {Object} other The benchmark to compare.
@returns {Number} Returns `-1` if slower, `1` if faster, and `0` if indeterminate. | getScore | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function getU(sampleA, sampleB) {
return reduce(sampleA, function(total, xA) {
return total + getScore(xA, sampleB);
}, 0);
} | Determines if a benchmark is faster than another.
@memberOf Benchmark
@param {Object} other The benchmark to compare.
@returns {Number} Returns `-1` if slower, `1` if faster, and `0` if indeterminate. | getU | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function getZ(u) {
return (u - ((size1 * size2) / 2)) / sqrt((size1 * size2 * (size1 + size2 + 1)) / 12);
} | Determines if a benchmark is faster than another.
@memberOf Benchmark
@param {Object} other The benchmark to compare.
@returns {Number} Returns `-1` if slower, `1` if faster, and `0` if indeterminate. | getZ | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function reset() {
var data,
event,
me = this,
index = 0,
changes = { 'length': 0 },
queue = { 'length': 0 };
if (me.running && !calledBy.abort) {
// no worries, `reset()` is called within `abort()`
calledBy.reset = true;
me.abort();
delete called... | Reset properties and abort if running.
@memberOf Benchmark
@returns {Object} The benchmark instance. | reset | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function toStringBench() {
var me = this,
error = me.error,
hz = me.hz,
id = me.id,
stats = me.stats,
size = stats.sample.length,
pm = support.java ? '+/-' : '\xb1',
result = me.name || (isNaN(id) ? id : '<Test #' + id + '>');
if (error) {
result +=... | Displays relevant benchmark information when coerced to a string.
@name toString
@memberOf Benchmark
@returns {String} A string representation of the benchmark instance. | toStringBench | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function clock() {
var applet,
options = Benchmark.options,
template = { 'begin': 's$=new n$', 'end': 'r$=(new n$-s$)/1e3', 'uid': uid },
timers = [{ 'ns': timer.ns, 'res': max(0.0015, getRes('ms')), 'unit': 'ms' }];
// lazy define for hi-res timers
clock = function(clone) {
v... | Clocks the time taken to execute a test per cycle (secs).
@private
@param {Object} bench The benchmark instance.
@returns {Number} The time taken. | clock | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function getRes(unit) {
var measured,
begin,
count = 30,
divisor = 1e3,
ns = timer.ns,
sample = [];
// get average smallest measurable time
while (count--) {
if (unit == 'us') {
divisor = 1e6;
if (ns.stop) {
ns.... | Gets the current timer's minimum resolution (secs). | getRes | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function preprocess(code) {
return interpolate(code, template).replace(/\$/g, /\d+/.exec(uid));
} | Replaces all occurrences of `$` with a unique number and
template tokens with content. | preprocess | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function compute(bench, options) {
options || (options = {});
var async = options.async,
elapsed = 0,
initCount = bench.initCount,
minSamples = bench.minSamples,
queue = [],
sample = bench.stats.sample;
/**
* Adds a clone to the queue.
*/
function enqu... | Computes stats on benchmark results.
@private
@param {Object} bench The benchmark instance.
@param {Object} options The options object. | compute | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function update(event) {
var clone = this,
type = event.type;
if (bench.running) {
if (type == 'start') {
// Note: `clone.minTime` prop is inited in `clock()`
clone.count = bench.initCount;
}
else {
if (type == 'error') {
bench.err... | Updates the clone/original benchmarks to keep their data in sync. | update | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function evaluate(event) {
var critical,
df,
mean,
moe,
rme,
sd,
sem,
variance,
clone = event.target,
done = bench.aborted,
now = +new Date,
size = sample.push(clone.times.period),
maxedOut = si... | Determines if more clones should be queued or if cycling should stop. | evaluate | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function cycle(clone, options) {
options || (options = {});
var deferred;
if (clone instanceof Deferred) {
deferred = clone;
clone = clone.benchmark;
}
var clocked,
cycles,
divisor,
event,
minTime,
period,
async = options.async,
b... | Cycles a benchmark until a run `count` can be established.
@private
@param {Object} clone The cloned benchmark instance.
@param {Object} options The options object. | cycle | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function run(options) {
var me = this,
event = Event('start');
// set `running` to `false` so `reset()` won't call `abort()`
me.running = false;
me.reset();
me.running = true;
me.count = me.initCount;
me.times.timeStamp = +new Date;
me.emit(event);
if (!event.cancelled) {
... | Runs the benchmark.
@memberOf Benchmark
@param {Object} [options={}] Options object.
@returns {Object} The benchmark instance.
@example
// basic usage
bench.run();
// or with options
bench.run({ 'async': true }); | run | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function arrayEach(array, iteratee) {
var index = -1,
length = array.length;
while (++index < length) {
if (iteratee(array[index], index, array) === false) {
break;
}
}
return array;
} | A specialized version of `_.forEach` for arrays without support for
callback shorthands or `this` binding.
@private
@param {Array} array The array to iterate over.
@param {Function} iteratee The function invoked per iteration.
@returns {Array} Returns `array`. | arrayEach | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function arrayEachRight(array, iteratee) {
var length = array.length;
while (length--) {
if (iteratee(array[length], length, array) === false) {
break;
}
}
return array;
} | A specialized version of `_.forEachRight` for arrays without support for
callback shorthands or `this` binding.
@private
@param {Array} array The array to iterate over.
@param {Function} iteratee The function invoked per iteration.
@returns {Array} Returns `array`. | arrayEachRight | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function arrayEvery(array, predicate) {
var index = -1,
length = array.length;
while (++index < length) {
if (!predicate(array[index], index, array)) {
return false;
}
}
return true;
} | A specialized version of `_.every` for arrays without support for callback
shorthands or `this` binding.
@private
@param {Array} array The array to iterate over.
@param {Function} predicate The function invoked per iteration.
@returns {Array} Returns `true` if all elements pass the predicate check,
else `false` | arrayEvery | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function arrayFilter(array, predicate) {
var index = -1,
length = array.length,
resIndex = -1,
result = [];
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result[++resIndex] = value;
}
}
return result;
} | A specialized version of `_.filter` for arrays without support for callback
shorthands or `this` binding.
@private
@param {Array} array The array to iterate over.
@param {Function} predicate The function invoked per iteration.
@returns {Array} Returns the new filtered array. | arrayFilter | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function arrayMap(array, iteratee) {
var index = -1,
length = array.length,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
} | A specialized version of `_.map` for arrays without support for callback
shorthands or `this` binding.
@private
@param {Array} array The array to iterate over.
@param {Function} iteratee The function invoked per iteration.
@returns {Array} Returns the new mapped array. | arrayMap | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function arrayReduce(array, iteratee, accumulator, initFromArray) {
var index = -1,
length = array.length;
if (initFromArray && length) {
accumulator = array[++index];
}
while (++index < length) {
accumulator = iteratee(accumulator, array[index], index, array);
}
return accu... | A specialized version of `_.reduce` for arrays without support for callback
shorthands or `this` binding.
@private
@param {Array} array The array to iterate over.
@param {Function} iteratee The function invoked per iteration.
@param {*} [accumulator] The initial value.
@param {boolean} [initFromArray=false] Specify us... | arrayReduce | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function arrayReduceRight(array, iteratee, accumulator, initFromArray) {
var length = array.length;
if (initFromArray && length) {
accumulator = array[--length];
}
while (length--) {
accumulator = iteratee(accumulator, array[length], length, array);
}
return accumulator;
} | A specialized version of `_.reduceRight` for arrays without support for
callback shorthands or `this` binding.
@private
@param {Array} array The array to iterate over.
@param {Function} iteratee The function invoked per iteration.
@param {*} [accumulator] The initial value.
@param {boolean} [initFromArray=false] Speci... | arrayReduceRight | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function arraySome(array, predicate) {
var index = -1,
length = array.length;
while (++index < length) {
if (predicate(array[index], index, array)) {
return true;
}
}
return false;
} | A specialized version of `_.some` for arrays without support for callback
shorthands or `this` binding.
@private
@param {Array} array The array to iterate over.
@param {Function} predicate The function invoked per iteration.
@returns {boolean} Returns `true` if any element passes the predicate check,
else `false`. | arraySome | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseCompareAscending(value, other) {
if (value !== other) {
var valIsReflexive = value === value,
othIsReflexive = other === other;
if (value > other || !valIsReflexive || (typeof value == 'undefined' && othIsReflexive)) {
return 1;
}
if (value < other || !othIsRe... | The base implementation of `compareAscending` which compares values and
sorts them in ascending order without guaranteeing a stable sort.
@private
@param {*} value The value to compare to `other`.
@param {*} other The value to compare to `value`.
@returns {number} Returns the sort order indicator for `value`. | baseCompareAscending | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseIndexOf(array, value, fromIndex) {
if (value !== value) {
return indexOfNaN(array, fromIndex);
}
var index = (fromIndex || 0) - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
} | The base implementation of `_.indexOf` without support for `fromIndex`
bounds checks and binary searches.
@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, else `... | baseIndexOf | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseSlice(array) {
var index = -1,
length = array ? array.length : 0,
result = Array(length);
while (++index < length) {
result[index] = array[index];
}
return result;
} | The base implementation of `_.slice` without support for `start` and `end`
arguments.
@private
@param {Array} array The array to slice.
@returns {Array} Returns the slice of `array`. | baseSlice | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function charAtCallback(string) {
return string.charCodeAt(0);
} | Used by `_.max` and `_.min` as the default callback for string values.
@private
@param {string} string The string to inspect.
@returns {number} Returns the code unit of the first character of the string. | charAtCallback | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function charsLeftIndex(string, chars) {
var index = -1,
length = string.length;
while (++index < length && chars.indexOf(string.charAt(index)) > -1) {}
return index;
} | Used by `_.trim` and `_.trimLeft` to get the index of the first character
of `string` that is not found in `chars`.
@private
@param {string} string The string to inspect.
@param {string} chars The characters to find.
@returns {number} Returns the index of the first character not found in `chars`. | charsLeftIndex | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function charsRightIndex(string, chars) {
var index = string.length;
while (index-- && chars.indexOf(string.charAt(index)) > -1) {}
return index;
} | Used by `_.trim` and `_.trimRight` to get the index of the last character
of `string` that is not found in `chars`.
@private
@param {string} string The string to inspect.
@param {string} chars The characters to find.
@returns {number} Returns the index of the last character not found in `chars`. | charsRightIndex | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function compareAscending(object, other) {
return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
} | Used by `_.sortBy` to compare transformed elements of `collection` and stable
sort them in ascending order.
@private
@param {Object} object The object to compare to `other`.
@param {Object} other The object to compare to `object`.
@returns {number} Returns the sort order indicator for `object`. | compareAscending | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function compareMultipleAscending(object, other) {
var index = -1,
objCriteria = object.criteria,
othCriteria = other.criteria,
length = objCriteria.length;
while (++index < length) {
var result = baseCompareAscending(objCriteria[index], othCriteria[index]);
if (result) {
... | Used by `_.sortBy` to compare multiple properties of each element in a
collection and stable sort them in ascending order.
@private
@param {Object} object The object to compare to `other`.
@param {Object} other The object to compare to `object`.
@returns {number} Returns the sort order indicator for `object`. | compareMultipleAscending | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function deburrLetter(letter) {
return deburredLetters[letter];
} | Used by `_.deburr` to convert latin-1 to basic latin letters.
@private
@param {string} letter The matched letter to deburr.
@returns {string} Returns the deburred letter. | deburrLetter | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function escapeHtmlChar(chr) {
return htmlEscapes[chr];
} | Used by `_.escape` to convert characters to HTML entities.
@private
@param {string} chr The matched character to escape.
@returns {string} Returns the escaped character. | escapeHtmlChar | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function escapeStringChar(chr) {
return '\\' + stringEscapes[chr];
} | Used by `_.template` to escape characters for inclusion in compiled
string literals.
@private
@param {string} chr The matched character to escape.
@returns {string} Returns the escaped character. | escapeStringChar | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function indexOfNaN(array, fromIndex, fromRight) {
var length = array.length,
index = fromRight ? (fromIndex || length) : ((fromIndex || 0) - 1);
while ((fromRight ? index-- : ++index < length)) {
var other = array[index];
if (other !== other) {
return index;
}
}
retur... | Gets the index at which the first occurrence of `NaN` is found in `array`.
If `fromRight` is provided elements of `array` are iterated from right to left.
@private
@param {Array} array The array to search.
@param {number} [fromIndex] The index to search from.
@param {boolean} [fromRight=false] Specify iterating from r... | indexOfNaN | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isIndex(value, length) {
value = +value;
return value > -1 && value % 1 == 0 && (length == null || value < length);
} | Checks if `value` is valid array-like index.
@private
@param {*} value The value to check.
@param {number} [length] The upper bound of a valid index.
@returns {boolean} Returns `true` if `value` is a valid index, else `false`. | isIndex | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function isWhitespace(charCode) {
return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 ||
(charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode ==... | Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a
character code is whitespace.
@private
@param {number} charCode The character code to inspect.
@returns {boolean} Returns `true` if `charCode` is whitespace, else `false`. | isWhitespace | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function replaceHolders(array, placeholder) {
var index = -1,
length = array.length,
resIndex = -1,
result = [];
while (++index < length) {
if (array[index] === placeholder) {
array[index] = PLACEHOLDER;
result[++resIndex] = index;
}
}
return result;
... | Replaces all `placeholder` elements in `array` with an internal placeholder
and returns an array of their indexes.
@private
@param {Array} array The array to modify.
@param {*} placeholder The placeholder to replace.
@returns {Array} Returns the new array of placeholder indexes. | replaceHolders | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function sortedUniq(array, iteratee) {
var seen,
index = -1,
length = array.length,
resIndex = -1,
result = [];
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value, index, array) : value;
if (!index || seen !== compute... | An implementation of `_.uniq` optimized for sorted arrays without support
for callback shorthands and `this` binding.
@private
@param {Array} array The array to inspect.
@param {Function} [iteratee] The function invoked per iteration.
@returns {Array} Returns the new duplicate-value-free array. | sortedUniq | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function trimmedLeftIndex(string) {
var index = -1,
length = string.length;
while (++index < length && isWhitespace(string.charCodeAt(index))) {}
return index;
} | Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace
character of `string`.
@private
@param {string} string The string to inspect.
@returns {number} Returns the index of the first non-whitespace character. | trimmedLeftIndex | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function trimmedRightIndex(string) {
var index = string.length;
while (index-- && isWhitespace(string.charCodeAt(index))) {}
return index;
} | Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace
character of `string`.
@private
@param {string} string The string to inspect.
@returns {number} Returns the index of the last non-whitespace character. | trimmedRightIndex | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function unescapeHtmlChar(chr) {
return htmlUnescapes[chr];
} | Used by `_.unescape` to convert HTML entities to characters.
@private
@param {string} chr The matched character to unescape.
@returns {string} Returns the unescaped character. | unescapeHtmlChar | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function LodashWrapper(value, chainAll, queue) {
this.__chain__ = !!chainAll;
this.__queue__ = queue || [];
this.__wrapped__ = value;
} | The base constructor for creating `lodash` wrapper objects.
@private
@param {*} value The value to wrap.
@param {boolean} [chainAll=false] Enable chaining for all wrapper methods.
@param {Array} [queue=[]] Actions to peform to resolve the unwrapped value. | LodashWrapper | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function LazyWrapper(value) {
this.dir = 1;
this.dropCount = 0;
this.filtered = false;
this.iteratees = null;
this.takeCount = POSITIVE_INFINITY;
this.views = null;
this.wrapped = value;
} | Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
@private
@param {*} value The value to wrap. | LazyWrapper | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function lazyClone() {
var iteratees = this.iteratees,
views = this.views,
result = new LazyWrapper(this.wrapped);
result.dir = this.dir;
result.dropCount = this.dropCount;
result.filtered = this.filtered;
result.iteratees = iteratees ? baseSlice(iteratees) : null;
... | Creates a clone of the lazy wrapper object.
@private
@name clone
@memberOf LazyWrapper
@returns {Object} Returns the cloned `LazyWrapper` object. | lazyClone | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function lazyReverse() {
var filtered = this.filtered,
result = filtered ? new LazyWrapper(this) : this.clone();
result.dir = this.dir * -1;
result.filtered = filtered;
return result;
} | Reverses the direction of lazy iteration.
@private
@name reverse
@memberOf LazyWrapper
@returns {Object} Returns the new reversed `LazyWrapper` object. | lazyReverse | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function lazyValue() {
var array = this.wrapped.value(),
dir = this.dir,
isRight = dir < 0,
length = array.length,
view = getView(0, length, this.views),
start = view.start,
end = view.end,
dropCount = this.dropCount,
takeCount = nati... | Extracts the unwrapped value from its lazy wrapper.
@private
@name value
@memberOf LazyWrapper
@returns {*} Returns the unwrapped value. | lazyValue | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function MapCache() {
this.__data__ = {};
} | Creates a cache object to store key/value pairs.
@private
@static
@name Cache
@memberOf _.memoize | MapCache | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function mapGet(key) {
return this.__data__[key];
} | Gets the cached value for `key`.
@private
@name get
@memberOf _.memoize.Cache
@param {string} key The key of the value to retrieve.
@returns {*} Returns the cached value. | mapGet | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function mapHas(key) {
return key != '__proto__' && hasOwnProperty.call(this.__data__, key);
} | Checks if a cached value for `key` exists.
@private
@name has
@memberOf _.memoize.Cache
@param {string} key The name of the entry to check.
@returns {boolean} Returns `true` if an entry for `key` exists, else `false`. | mapHas | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function mapSet(key, value) {
if (key != '__proto__') {
this.__data__[key] = value;
}
return this;
} | Adds `value` to `key` of the cache.
@private
@name set
@memberOf _.memoize.Cache
@param {string} key The key of the value to cache.
@param {*} value The value to cache.
@returns {Object} Returns the cache object. | mapSet | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function SetCache(values) {
var length = values ? values.length : 0;
this.data = { 'number': {}, 'set': new Set };
while (length--) {
this.push(values[length]);
}
} | Creates a cache object to store unique values.
@private
@param {Array} [values] The values to cache. | SetCache | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function cacheIndexOf(cache, value) {
var type = typeof value,
data = cache.data,
result = type == 'number' ? data[type][value] : data.set.has(value);
return result ? 0 : -1;
} | Checks if `value` is in `cache` mimicking the return signature of
`_.indexOf` by returning `0` if the value is found, else `-1`.
@private
@param {Object} cache The cache to search.
@param {*} value The value to search for.
@returns {number} Returns `0` if `value` is found, else `-1`. | cacheIndexOf | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function cachePush(value) {
var data = this.data,
type = typeof value;
if (type == 'number') {
data[type][value] = true;
} else {
data.set.add(value);
}
} | Adds `value` to the cache.
@private
@name push
@memberOf SetCache
@param {*} value The value to cache. | cachePush | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function arrayMax(array) {
var index = -1,
length = array.length,
result = NEGATIVE_INFINITY;
while (++index < length) {
var value = array[index];
if (value > result) {
result = value;
}
}
return result;
} | A specialized version of `_.max` for arrays without support for iteratees.
@private
@param {Array} array The array to iterate over.
@returns {*} Returns the maximum value. | arrayMax | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function arrayMin(array) {
var index = -1,
length = array.length,
result = POSITIVE_INFINITY;
while (++index < length) {
var value = array[index];
if (value < result) {
result = value;
}
}
return result;
} | A specialized version of `_.min` for arrays without support for iteratees.
@private
@param {Array} array The array to iterate over.
@returns {*} Returns the minimum value. | arrayMin | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function assignDefaults(objectValue, sourceValue) {
return typeof objectValue == 'undefined' ? sourceValue : objectValue;
} | Used by `_.defaults` to customize its `_.assign` use.
@private
@param {*} objectValue The destination object property value.
@param {*} sourceValue The source object property value.
@returns {*} Returns the value to assign to the destination object. | assignDefaults | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function assignOwnDefaults(objectValue, sourceValue, key, object) {
return (typeof objectValue == 'undefined' || !hasOwnProperty.call(object, key))
? sourceValue
: objectValue;
} | Used by `_.template` to customize its `_.assign` use.
**Note:** This method is like `assignDefaults` except that it ignores
inherited property values when checking if a property is `undefined`.
@private
@param {*} objectValue The destination object property value.
@param {*} sourceValue The source object property val... | assignOwnDefaults | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseAssign(object, source, customizer) {
var index = -1,
props = keys(source),
length = props.length;
while (++index < length) {
var key = props[index];
object[key] = customizer
? customizer(object[key], source[key], key, object, source)
: so... | The base implementation of `_.assign` without support for argument juggling,
multiple sources, and `this` binding.
@private
@param {Object} object The destination object.
@param {Object} source The source object.
@param {Function} [customizer] The function to customize assigning values.
@returns {Object} Returns the d... | baseAssign | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseAt(collection, props) {
var index = -1,
length = collection ? collection.length : 0,
isArr = isLength(length),
propsLength = props.length,
result = Array(propsLength);
while(++index < propsLength) {
var key = props[index];
if (isArr) {
... | The base implementation of `_.at` without support for strings and individual
key arguments.
@private
@param {Array|Object} collection The collection to iterate over.
@param {number[]|string[]} [props] The property names or indexes of elements to pick.
@returns {Array} Returns the new array of picked elements. | baseAt | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseBindAll(object, methodNames) {
var index = -1,
length = methodNames.length;
while (++index < length) {
var key = methodNames[index];
object[key] = createWrapper(object[key], BIND_FLAG, object);
}
return object;
} | The base implementation of `_.bindAll` without support for individual
method name arguments.
@private
@param {Object} object The object to bind and assign the bound methods to.
@param {string[]} methodNames The object method names to bind.
@returns {Object} Returns `object`. | baseBindAll | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseCallback(func, thisArg, argCount) {
var type = typeof func;
if (type == 'function') {
if (typeof thisArg == 'undefined') {
return func;
}
var data = getData(func);
if (typeof data == 'undefined') {
var support = lodash.support;
if (... | The base implementation of `_.callback` without support for creating
"_.pluck" and "_.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 accept... | baseCallback | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {
var result;
if (customizer) {
result = object ? customizer(value, key, object) : customizer(value);
}
if (typeof result != 'undefined') {
return result;
}
var isArr = isArray(value);
re... | The base implementation of `_.clone` without support for argument juggling
and `this` binding.
@private
@param {*} value The value to clone.
@param {boolean} [isDeep=false] Specify a deep clone.
@param {Function} [customizer] The function to customize cloning values.
@param {string} [key] The key of `value`.
@param {O... | baseClone | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseCreate(prototype) {
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 | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseDifference(array, values) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
var index = -1,
indexOf = getIndexOf(),
isCommon = indexOf == baseIndexOf,
cache = isCommon && values.length >= 200 && createCache(values),
... | The base implementation of `_.difference` which accepts a single array
of values to exclude.
@private
@param {Array} array The array to inspect.
@param {Array} values The values to exclude.
@returns {Array} Returns the new array of filtered values. | baseDifference | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseEach(collection, iteratee) {
var length = collection ? collection.length : 0;
if (!isLength(length)) {
return baseForOwn(collection, iteratee);
}
var index = -1,
iterable = toObject(collection);
while (++index < length) {
if (iteratee(iterable[index]... | The base implementation of `_.forEach` without support for callback
shorthands and `this` binding.
@private
@param {Array|Object|string} collection The collection to iterate over.
@param {Function} iteratee The function invoked per iteration.
@returns {Array|Object|string} Returns `collection`. | baseEach | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseEachRight(collection, iteratee) {
var length = collection ? collection.length : 0;
if (!isLength(length)) {
return baseForOwnRight(collection, iteratee);
}
var iterable = toObject(collection);
while (length--) {
if (iteratee(iterable[length], length, iterable) ... | The base implementation of `_.forEachRight` without support for callback
shorthands and `this` binding.
@private
@param {Array|Object|string} collection The collection to iterate over.
@param {Function} iteratee The function invoked per iteration.
@returns {Array|Object|string} Returns `collection`. | baseEachRight | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseEvery(collection, predicate) {
var result = true;
baseEach(collection, function(value, index, collection) {
result = !!predicate(value, index, collection);
return result;
});
return result;
} | The base implementation of `_.every` without support for callback
shorthands or `this` binding.
@private
@param {Array|Object|string} collection The collection to iterate over.
@param {Function} predicate The function invoked per iteration.
@returns {Array} Returns `true` if all elements pass the predicate check,
els... | baseEvery | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseFilter(collection, predicate) {
var result = [];
baseEach(collection, function(value, index, collection) {
if (predicate(value, index, collection)) {
result.push(value);
}
});
return result;
} | The base implementation of `_.filter` without support for callback
shorthands or `this` binding.
@private
@param {Array|Object|string} collection The collection to iterate over.
@param {Function} predicate The function invoked per iteration.
@returns {Array} Returns the new filtered array. | baseFilter | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseFind(collection, predicate, eachFunc, retKey) {
var result;
eachFunc(collection, function(value, key, collection) {
if (predicate(value, key, collection)) {
result = retKey ? key : value;
return false;
}
});
return result;
} | The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,
without support for callback shorthands and `this` binding, which iterates
over `collection` using the provided `eachFunc`.
@private
@param {Array|Object|string} collection The collection to search.
@param {Function} predicate The fun... | baseFind | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseFlatten(array, isDeep, isStrict, fromIndex) {
var index = (fromIndex || 0) - 1,
length = array.length,
resIndex = -1,
result = [];
while (++index < length) {
var value = array[index];
if (value && typeof value == 'object' && typeof value.length ==... | The base implementation of `_.flatten` with added support for restricting
flattening and specifying the start index.
@private
@param {Array} array The array to flatten.
@param {boolean} [isDeep=false] Specify a deep flatten.
@param {boolean} [isStrict=false] Restrict flattening to arrays and `arguments` objects.
@para... | baseFlatten | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseFor(object, iteratee, keysFunc) {
var index = -1,
iterable = toObject(object),
props = keysFunc(object),
length = props.length;
while (++index < length) {
var key = props[index];
if (iteratee(iterable[key], key, iterable) === false) {
bre... | The base implementation of `baseForIn` and `baseForOwn` which iterates
over `object` properties returned by `keysFunc` invoking `iteratee` for
each property. Iterator functions may exit iteration early by explicitly
returning `false`.
@private
@param {Object} object The object to iterate over.
@param {Function} iterat... | baseFor | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseForRight(object, iteratee, keysFunc) {
var iterable = toObject(object),
props = keysFunc(object),
length = props.length;
while (length--) {
var key = props[length];
if (iteratee(iterable[key], key, iterable) === false) {
break;
}
}
... | This function is like `baseFor` except that it iterates over properties
in the opposite order.
@private
@param {Object} object The object to iterate over.
@param {Function} iteratee The function invoked per iteration.
@param {Function} keysFunc The function to get the keys of `object`.
@returns {Object} Returns `objec... | baseForRight | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseForIn(object, iteratee) {
return baseFor(object, iteratee, keysIn);
} | The base implementation of `_.forIn` without support for callback
shorthands and `this` binding.
@private
@param {Object} object The object to iterate over.
@param {Function} iteratee The function invoked per iteration.
@returns {Object} Returns `object`. | baseForIn | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseForOwn(object, iteratee) {
return baseFor(object, iteratee, keys);
} | The base implementation of `_.forOwn` without support for callback
shorthands and `this` binding.
@private
@param {Object} object The object to iterate over.
@param {Function} iteratee The function invoked per iteration.
@returns {Object} Returns `object`. | baseForOwn | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseForOwnRight(object, iteratee) {
return baseForRight(object, iteratee, keys);
} | The base implementation of `_.forOwnRight` without support for callback
shorthands and `this` binding.
@private
@param {Object} object The object to iterate over.
@param {Function} iteratee The function invoked per iteration.
@returns {Object} Returns `object`. | baseForOwnRight | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseFunctions(object, props) {
var index = -1,
length = props.length,
resIndex = -1,
result = [];
while (++index < length) {
var key = props[index];
if (isFunction(object[key])) {
result[++resIndex] = key;
}
}
return resul... | The base implementation of `_.functions` which creates an array of
`object` function property names filtered from those provided.
@private
@param {Object} object The object to inspect.
@param {Array} props The property names to filter.
@returns {Array} Returns the new array of filtered property names. | baseFunctions | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseIsEqual(value, other, customizer, isWhere, stackA, stackB) {
var result = customizer && !stackA ? customizer(value, other) : undefined;
if (typeof result != 'undefined') {
return !!result;
}
// exit early for identical values
if (value === other) {
// treat `+0... | The base implementation of `_.isEqual`, without support for `thisArg`
binding, which allows partial "_.where" style comparisons.
@private
@param {*} value The value to compare to `other`.
@param {*} other The value to compare to `value`.
@param {Function} [customizer] The function to customize comparing values.
@param... | baseIsEqual | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseInvoke(collection, methodName, args) {
var index = -1,
isFunc = typeof methodName == 'function',
length = collection ? collection.length : 0,
result = [];
if (isLength(length)) {
result.length = length;
}
baseEach(collection, function(value) {
... | The base implementation of `_.invoke` which requires additional arguments
be provided as an array of arguments rather than individually.
@private
@param {Array|Object|string} collection The collection to iterate over.
@param {Function|string} methodName The name of the method to invoke or
the function invoked per ite... | baseInvoke | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseMap(collection, iteratee) {
var result = [];
baseEach(collection, function(value, key, collection) {
result.push(iteratee(value, key, collection));
});
return result;
} | The base implementation of `_.map` without support for callback shorthands
or `this` binding.
@private
@param {Array|Object|string} collection The collection to iterate over.
@param {Function} iteratee The function invoked per iteration.
@returns {Array} Returns the new mapped array. | baseMap | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseMerge(object, source, customizer, stackA, stackB) {
var isSrcArr = isArrayLike(source);
(isSrcArr ? arrayEach : baseForOwn)(source, function(srcValue, key, source) {
var isArr = isArrayLike(srcValue),
isObj = isPlainObject(srcValue),
value = object[key];
... | The base implementation of `_.merge` without support for argument juggling,
multiple sources, and `this` binding.
@private
@param {Object} object The destination object.
@param {Object} source The source object.
@param {Function} [customizer] The function to customize merging properties.
@param {Array} [stackA=[]] Tra... | baseMerge | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function basePullAt(array, indexes) {
var length = indexes.length,
result = baseAt(array, indexes);
indexes.sort(baseCompareAscending);
while (length--) {
var index = parseFloat(indexes[length]);
if (index != previous && isIndex(index)) {
var previous = index;
... | The base implementation of `_.pullAt` without support for individual
index arguments.
@private
@param {Array} array The array to modify.
@param {number[]} indexes The indexes of elements to remove.
@returns {Array} Returns the new array of removed elements. | basePullAt | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseRandom(min, max) {
return min + floor(nativeRandom() * (max - min + 1));
} | The base implementation of `_.random` without support for argument juggling
and returning floating-point numbers.
@private
@param {number} min The minimum possible value.
@param {number} max The maximum possible value.
@returns {number} Returns the random number. | baseRandom | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
eachFunc(collection, function(value, index, collection) {
accumulator = initFromCollection
? (initFromCollection = false, value)
: iteratee(accumulator, value, index, collection)
});
retu... | The base implementation of `_.reduce` and `_.reduceRight` without support
for callback shorthands or `this` binding, which iterates over `collection`
usingthe provided `eachFunc`.
@private
@param {Array|Object|string} collection The collection to iterate over.
@param {Function} iteratee The function invoked per iterat... | baseReduce | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseSome(collection, predicate) {
var result;
baseEach(collection, function(value, index, collection) {
result = predicate(value, index, collection);
return !result;
});
return !!result;
} | The base implementation of `_.some` without support for callback shorthands
or `this` binding.
@private
@param {Array|Object|string} collection The collection to iterate over.
@param {Function} predicate The function invoked per iteration.
@returns {boolean} Returns `true` if any element passes the predicate check,
e... | baseSome | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseSortedIndex(array, value, iteratee, retHighest) {
var low = 0,
high = array ? array.length : low;
value = iteratee(value);
var valIsNaN = value !== value,
valIsUndef = typeof value == 'undefined';
while (low < high) {
var mid = floor((low + high) / 2),... | The base implementation of `_.sortedIndex` and `_.sortedLastIndex` without
support for callback shorthands and `this` binding.
@private
@param {Array} array The array to inspect.
@param {*} value The value to evaluate.
@param {Function} iteratee The function invoked per iteration.
@param {boolean} [retHighest=false] S... | baseSortedIndex | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseUniq(array, iteratee) {
var index = -1,
indexOf = getIndexOf(),
length = array.length,
isCommon = indexOf == baseIndexOf,
isLarge = isCommon && length >= 200,
seen = isLarge && createCache(),
result = [];
if (seen) {
indexOf =... | The base implementation of `_.uniq` without support for callback shorthands
and `this` binding.
@private
@param {Array} array The array to inspect.
@param {Function} [iteratee] The function invoked per iteration.
@returns {Array} Returns the new duplicate-value-free array. | baseUniq | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function baseValues(object, keysFunc) {
var index = -1,
props = keysFunc(object),
length = props.length,
result = Array(length);
while (++index < length) {
result[index] = object[props[index]];
}
return result;
} | The base implementation of `_.values` and `_.valuesIn` which creates an
array of `object` property values corresponding to the property names
returned by `keysFunc`.
@private
@param {Object} object The object to inspect.
@param {Function} keysFunc The function to get the keys of `object`.
@returns {Object} Returns the... | baseValues | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function bufferClone(buffer) {
return bufferSlice.call(buffer, 0);
} | Creates a clone of the given array buffer.
@private
@param {ArrayBuffer} buffer The array buffer to clone.
@returns {ArrayBuffer} Returns the cloned array buffer. | bufferClone | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function clonePassthru(value) {
return isCloneable(value) ? undefined : value;
} | Used by `_.matches` to clone `source` values, letting uncloneable values
passthu instead of returning empty objects.
@private
@param {*} value The value to clone.
@returns {*} Returns the cloned value. | clonePassthru | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function composeArgs(args, partials, holders) {
var holdersLength = holders.length,
argsIndex = -1,
argsLength = nativeMax(args.length - holdersLength, 0),
leftIndex = -1,
leftLength = partials.length,
result = Array(argsLength + leftLength);
while (++leftI... | Creates an array that is the composition of partially applied arguments,
placeholders, and provided arguments into a single array of arguments.
@private
@param {Array|Object} args The provided arguments.
@param {Array} partials The arguments to prepend to those provided.
@param {Array} holders The `partials` placehold... | composeArgs | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function composeArgsRight(args, partials, holders) {
var holdersIndex = -1,
holdersLength = holders.length,
argsIndex = -1,
argsLength = nativeMax(args.length - holdersLength, 0),
rightIndex = -1,
rightLength = partials.length,
result = Array(argsLength ... | This function is like `composeArgs` except that the arguments composition
is tailored for `_.partialRight`.
@private
@param {Array|Object} args The provided arguments.
@param {Array} partials The arguments to append to those provided.
@param {Array} holders The `partials` placeholder indexes.
@returns {Array} Returns ... | composeArgsRight | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function createAggregator(setter, initializer) {
return function(collection, iteratee, thisArg) {
iteratee = getCallback(iteratee, thisArg, 3);
var result = initializer ? initializer() : {};
if (isArray(collection)) {
var index = -1,
length = collection.length;
... | Creates a function that aggregates a collection, creating an accumulator
object composed from the results of running each element in the collection
through `iteratee`. The given setter function sets the keys and values of
the accumulator object. If `initializer` is provided it is used to initialize
the accumulator obje... | createAggregator | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
function createAssigner(assigner) {
return function() {
var length = arguments.length,
object = arguments[0];
if (length < 2 || object == null) {
return object;
}
if (length > 3 && isIterateeCall(arguments[1], arguments[2], arguments[3])) {
length =... | Creates a function that assigns properties of source object(s) to a given
destination object.
@private
@param {Function} assigner The function to handle assigning values.
@returns {Function} Returns the new assigner function. | createAssigner | javascript | codemix/fast.js | dist/bench.js | https://github.com/codemix/fast.js/blob/master/dist/bench.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.