repo stringlengths 5 106 | file_url stringlengths 78 301 | file_path stringlengths 4 211 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:56:49 2026-01-05 02:23:25 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/test/qunit-setup.js | test/qunit-setup.js | (function() {
QUnit.config.noglobals = true;
}());
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/test/objects.js | test/objects.js | (function() {
var _ = typeof require == 'function' ? require('..') : window._;
QUnit.module('Objects');
var testElement = typeof document === 'object' ? document.createElement('div') : void 0;
// Some browsers support typed arrays but not DataView and some applications could override DataView
var DataViewI... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | true |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/test/treeshake.js | test/treeshake.js | (function() {
// Tests in this module only work in the node.js environment.
if (typeof require !== 'function') return;
var fixturePrefix = __dirname + '/../test-treeshake/';
var moduleName = __dirname + '/../underscore-umd.js';
var fs = require('fs');
QUnit.module('Tree-shaking');
QUnit.test('should ha... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/test/arrays.js | test/arrays.js | (function() {
var _ = typeof require == 'function' ? require('..') : window._;
QUnit.module('Arrays');
QUnit.test('first', function(assert) {
assert.strictEqual(_.first([1, 2, 3]), 1, 'can pull out the first element of an array');
assert.strictEqual(_([1, 2, 3]).first(), 1, 'can perform OO-style "first(... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/test/functions.js | test/functions.js | (function() {
var _ = typeof require == 'function' ? require('..') : window._;
QUnit.module('Functions');
QUnit.config.asyncRetries = 3;
QUnit.test('bind', function(assert) {
var context = {name: 'moe'};
var func = function(arg) { return 'name: ' + (this.name || arg); };
var bound = _.bind(func, c... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/test/chaining.js | test/chaining.js | (function() {
var _ = typeof require == 'function' ? require('..') : window._;
QUnit.module('Chaining');
QUnit.test('map/flatten/reduce', function(assert) {
var lyrics = [
'I\'m a lumberjack and I\'m okay',
'I sleep all night and I work all day',
'He\'s a lumberjack and he\'s okay',
... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/test/vendor/qunit.js | test/vendor/qunit.js | /*!
* QUnit 2.10.1
* https://qunitjs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2020-07-04T23:21Z
*/
(function (global$1) {
'use strict';
global$1 = global$1 && global$1.hasOwnProperty('default') ? global$1['default']... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | true |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/docs/main.js | docs/main.js | (function() {
var functions = document.querySelectorAll('[data-name]');
var sections = document.querySelectorAll('.searchable_section');
var searchInput = document.getElementById('function_filter');
function searchValue() {
return searchInput.value.trim().replace(/^_\.?/, '');
}
function strIn(a, b) {... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/partial.js | modules/partial.js | import restArguments from './restArguments.js';
import executeBound from './_executeBound.js';
import _ from './underscore.js';
// Partially apply a function by creating a version that has had some of its
// arguments pre-filled, without changing its dynamic `this` context. `_` acts
// as a placeholder by default, all... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/_isBufferLike.js | modules/_isBufferLike.js | import createSizePropertyCheck from './_createSizePropertyCheck.js';
import getByteLength from './_getByteLength.js';
// Internal helper to determine whether we should spend extensive checks against
// `ArrayBuffer` et al.
export default createSizePropertyCheck(getByteLength);
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/isMap.js | modules/isMap.js | import tagTester from './_tagTester.js';
import { isIE11 } from './_stringTagBug.js';
import { ie11fingerprint, mapMethods } from './_methodFingerprint.js';
export default isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map');
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/_executeBound.js | modules/_executeBound.js | import baseCreate from './_baseCreate.js';
import isObject from './isObject.js';
// Internal function to execute `sourceFunc` bound to `context` with optional
// `args`. Determines whether to execute a function as a constructor or as a
// normal function.
export default function executeBound(sourceFunc, boundFunc, con... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/isEqual.js | modules/isEqual.js | import _ from './underscore.js';
import { toString, SymbolProto } from './_setup.js';
import getByteLength from './_getByteLength.js';
import isTypedArray from './isTypedArray.js';
import isFunction from './isFunction.js';
import { hasDataViewBug } from './_stringTagBug.js';
import isDataView from './isDataView.js';
i... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/memoize.js | modules/memoize.js | import has from './_has.js';
// Memoize an expensive function by storing its results.
export default function memoize(func, hasher) {
var memoize = function(key) {
var cache = memoize.cache;
var address = '' + (hasher ? hasher.apply(this, arguments) : key);
if (!has(cache, address)) cache[address] = func... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/_getByteLength.js | modules/_getByteLength.js | import shallowProperty from './_shallowProperty.js';
// Internal helper to obtain the `byteLength` property of an object.
export default shallowProperty('byteLength');
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/isNumber.js | modules/isNumber.js | import tagTester from './_tagTester.js';
export default tagTester('Number');
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/reduce.js | modules/reduce.js | import createReduce from './_createReduce.js';
// **Reduce** builds up a single result from a list of values, aka `inject`,
// or `foldl`.
export default createReduce(1);
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/propertyOf.js | modules/propertyOf.js | import noop from './noop.js';
import get from './get.js';
// Generates a function for a given object that returns a given property.
export default function propertyOf(obj) {
if (obj == null) return noop;
return function(path) {
return get(obj, path);
};
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/mixin.js | modules/mixin.js | import _ from './underscore.js';
import each from './each.js';
import functions from './functions.js';
import { push } from './_setup.js';
import chainResult from './_chainResult.js';
// Add your own custom functions to the Underscore object.
export default function mixin(obj) {
each(functions(obj), function(name) {... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/without.js | modules/without.js | import restArguments from './restArguments.js';
import difference from './difference.js';
// Return a version of the array that does not contain the specified value(s).
export default restArguments(function(array, otherArrays) {
return difference(array, otherArrays);
});
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/toArray.js | modules/toArray.js | import isArray from './isArray.js';
import { slice } from './_setup.js';
import isString from './isString.js';
import isArrayLike from './_isArrayLike.js';
import map from './map.js';
import identity from './identity.js';
import values from './values.js';
// Safely create a real, live array from anything iterable.
var... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/iteratee.js | modules/iteratee.js | import _ from './underscore.js';
import baseIteratee from './_baseIteratee.js';
// External wrapper for our callback generator. Users may customize
// `_.iteratee` if they want additional predicate/iteratee shorthand styles.
// This abstraction hides the internal-only `argCount` argument.
export default function itera... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/property.js | modules/property.js | import deepGet from './_deepGet.js';
import toPath from './_toPath.js';
// Creates a function that, when passed an object, will traverse that object’s
// properties down the given `path`, specified as an array of keys or indices.
export default function property(path) {
path = toPath(path);
return function(obj) {
... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/template.js | modules/template.js | import defaults from './defaults.js';
import _ from './underscore.js';
import './templateSettings.js';
// When customizing `_.templateSettings`, if you don't want to define an
// interpolation, evaluation or escaping regex, we need one that is
// guaranteed not to match.
var noMatch = /(.)^/;
// Certain characters ne... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/chain.js | modules/chain.js | import _ from './underscore.js';
// Start chaining a wrapped Underscore object.
export default function chain(obj) {
var instance = _(obj);
instance._chain = true;
return instance;
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/isSet.js | modules/isSet.js | import tagTester from './_tagTester.js';
import { isIE11 } from './_stringTagBug.js';
import { ie11fingerprint, setMethods } from './_methodFingerprint.js';
export default isIE11 ? ie11fingerprint(setMethods) : tagTester('Set');
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/compact.js | modules/compact.js | import filter from './filter.js';
// Trim out all falsy values from an array.
export default function compact(array) {
return filter(array, Boolean);
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/sample.js | modules/sample.js | import isArrayLike from './_isArrayLike.js';
import values from './values.js';
import getLength from './_getLength.js';
import random from './random.js';
import toArray from './toArray.js';
// Sample **n** random values from a collection using the modern version of the
// [Fisher-Yates shuffle](https://en.wikipedia.or... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/bindAll.js | modules/bindAll.js | import restArguments from './restArguments.js';
import flatten from './_flatten.js';
import bind from './bind.js';
// Bind a number of an object's methods to that object. Remaining arguments
// are the method names to be bound. Useful for ensuring that all callbacks
// defined on an object belong to it.
export default... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/unzip.js | modules/unzip.js | import max from './max.js';
import getLength from './_getLength.js';
import pluck from './pluck.js';
// Complement of zip. Unzip accepts an array of arrays and groups
// each array's elements on shared indices.
export default function unzip(array) {
var length = (array && max(array, getLength).length) || 0;
var re... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/wrap.js | modules/wrap.js | import partial from './partial.js';
// Returns the first function passed as an argument to the second,
// allowing you to adjust arguments, run code before and after, and
// conditionally execute the original function.
export default function wrap(func, wrapper) {
return partial(wrapper, func);
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/debounce.js | modules/debounce.js | import restArguments from './restArguments.js';
import now from './now.js';
// When a sequence of calls of the returned function ends, the argument
// function is triggered. The end of a sequence is defined by the `wait`
// parameter. If `immediate` is passed, the argument function will be
// triggered at the beginnin... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/noop.js | modules/noop.js | // Predicate-generating function. Often useful outside of Underscore.
export default function noop(){}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/once.js | modules/once.js | import partial from './partial.js';
import before from './before.js';
// Returns a function that will be executed at most one time, no matter how
// often you call it. Useful for lazy initialization.
export default partial(before, 2);
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/_stringTagBug.js | modules/_stringTagBug.js | import { supportsDataView } from './_setup.js';
import hasObjectTag from './_hasObjectTag.js';
// In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`.
// In IE 11, the most common among them, this problem also applies to
// `Map`, `WeakMap` and `Set`.
// Also, there are cases where an application can ove... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/isNaN.js | modules/isNaN.js | import { _isNaN } from './_setup.js';
import isNumber from './isNumber.js';
// Is the given value `NaN`?
export default function isNaN(obj) {
return isNumber(obj) && _isNaN(obj);
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/after.js | modules/after.js | // Returns a function that will only be executed on and after the Nth call.
export default function after(times, func) {
return function() {
if (--times < 1) {
return func.apply(this, arguments);
}
};
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/identity.js | modules/identity.js | // Keep the identity function around for default iteratees.
export default function identity(value) {
return value;
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/zip.js | modules/zip.js | import restArguments from './restArguments.js';
import unzip from './unzip.js';
// Zip together multiple lists into a single array -- elements that share
// an index go together.
export default restArguments(unzip);
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/delay.js | modules/delay.js | import restArguments from './restArguments.js';
// Delays a function for the given number of milliseconds, and then calls
// it with the arguments supplied.
export default restArguments(function(func, wait, args) {
return setTimeout(function() {
return func.apply(null, args);
}, wait);
});
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/keys.js | modules/keys.js | import isObject from './isObject.js';
import { nativeKeys, hasEnumBug } from './_setup.js';
import has from './_has.js';
import collectNonEnumProps from './_collectNonEnumProps.js';
// Retrieve the names of an object's own properties.
// Delegates to **ECMAScript 5**'s native `Object.keys`.
export default function key... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/constant.js | modules/constant.js | // Predicate-generating function. Often useful outside of Underscore.
export default function constant(value) {
return function() {
return value;
};
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/isError.js | modules/isError.js | import tagTester from './_tagTester.js';
export default tagTester('Error');
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/map.js | modules/map.js | import cb from './_cb.js';
import isArrayLike from './_isArrayLike.js';
import keys from './keys.js';
// Return the results of applying the iteratee to each element.
export default function map(obj, iteratee, context) {
iteratee = cb(iteratee, context);
var _keys = !isArrayLike(obj) && keys(obj),
length = (_... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/invoke.js | modules/invoke.js | import restArguments from './restArguments.js';
import isFunction from './isFunction.js';
import map from './map.js';
import deepGet from './_deepGet.js';
import toPath from './_toPath.js';
// Invoke a method (with arguments) on every item in a collection.
export default restArguments(function(obj, path, args) {
var... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/isArrayBuffer.js | modules/isArrayBuffer.js | import tagTester from './_tagTester.js';
export default tagTester('ArrayBuffer');
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/uniq.js | modules/uniq.js | import isBoolean from './isBoolean.js';
import cb from './_cb.js';
import getLength from './_getLength.js';
import contains from './contains.js';
// Produce a duplicate-free version of the array. If the array has already
// been sorted, you have the option of using a faster algorithm.
// The faster algorithm will not ... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/_optimizeCb.js | modules/_optimizeCb.js | // Internal function that returns an efficient (for current engines) version
// of the passed-in callback, to be repeatedly applied in other Underscore
// functions.
export default function optimizeCb(func, context, argCount) {
if (context === void 0) return func;
switch (argCount == null ? 3 : argCount) {
case... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/findWhere.js | modules/findWhere.js | import find from './find.js';
import matcher from './matcher.js';
// Convenience version of a common use case of `_.find`: getting the first
// object containing specific `key:value` pairs.
export default function findWhere(obj, attrs) {
return find(obj, matcher(attrs));
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/result.js | modules/result.js | import isFunction from './isFunction.js';
import toPath from './_toPath.js';
// Traverses the children of `obj` along `path`. If a child is a function, it
// is invoked with its parent as context. Returns the value of the final
// child, or `fallback` if any child is undefined.
export default function result(obj, path... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/has.js | modules/has.js | import _has from './_has.js';
import toPath from './_toPath.js';
// Shortcut function for checking if an object has a given property directly on
// itself (in other words, not on a prototype). Unlike the internal `has`
// function, this public version can also traverse nested properties.
export default function has(ob... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/isDate.js | modules/isDate.js | import tagTester from './_tagTester.js';
export default tagTester('Date');
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/reject.js | modules/reject.js | import filter from './filter.js';
import negate from './negate.js';
import cb from './_cb.js';
// Return all the elements for which a truth test fails.
export default function reject(obj, predicate, context) {
return filter(obj, negate(cb(predicate)), context);
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/_baseIteratee.js | modules/_baseIteratee.js | import identity from './identity.js';
import isFunction from './isFunction.js';
import isObject from './isObject.js';
import isArray from './isArray.js';
import matcher from './matcher.js';
import property from './property.js';
import optimizeCb from './_optimizeCb.js';
// An internal function to generate callbacks th... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/filter.js | modules/filter.js | import cb from './_cb.js';
import each from './each.js';
// Return all the elements that pass a truth test.
export default function filter(obj, predicate, context) {
var results = [];
predicate = cb(predicate, context);
each(obj, function(value, index, list) {
if (predicate(value, index, list)) results.push(... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/_toBufferView.js | modules/_toBufferView.js | import getByteLength from './_getByteLength.js';
// Internal function to wrap or shallow-copy an ArrayBuffer,
// typed array or DataView to a new view, reusing the buffer.
export default function toBufferView(bufferSource) {
return new Uint8Array(
bufferSource.buffer || bufferSource,
bufferSource.byteOffset ... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/mapObject.js | modules/mapObject.js | import cb from './_cb.js';
import keys from './keys.js';
// Returns the results of applying the `iteratee` to each element of `obj`.
// In contrast to `_.map` it returns an object.
export default function mapObject(obj, iteratee, context) {
iteratee = cb(iteratee, context);
var _keys = keys(obj),
length = _k... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/isRegExp.js | modules/isRegExp.js | import tagTester from './_tagTester.js';
export default tagTester('RegExp');
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/index.js | modules/index.js | // Named Exports
// =============
// Underscore.js 1.13.7
// https://underscorejs.org
// (c) 2009-2024 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
// Baseline setup.
export { VERSION } from '.... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/isSymbol.js | modules/isSymbol.js | import tagTester from './_tagTester.js';
export default tagTester('Symbol');
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/escape.js | modules/escape.js | import createEscaper from './_createEscaper.js';
import escapeMap from './_escapeMap.js';
// Function for escaping strings to HTML interpolation.
export default createEscaper(escapeMap);
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/pick.js | modules/pick.js | import restArguments from './restArguments.js';
import isFunction from './isFunction.js';
import optimizeCb from './_optimizeCb.js';
import allKeys from './allKeys.js';
import keyInObj from './_keyInObj.js';
import flatten from './_flatten.js';
// Return a copy of the object only containing the allowed properties.
exp... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/some.js | modules/some.js | import cb from './_cb.js';
import isArrayLike from './_isArrayLike.js';
import keys from './keys.js';
// Determine if at least one element in the object passes a truth test.
export default function some(obj, predicate, context) {
predicate = cb(predicate, context);
var _keys = !isArrayLike(obj) && keys(obj),
... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/max.js | modules/max.js | import isArrayLike from './_isArrayLike.js';
import values from './values.js';
import cb from './_cb.js';
import each from './each.js';
// Return the maximum element (or element-based computation).
export default function max(obj, iteratee, context) {
var result = -Infinity, lastComputed = -Infinity,
value, co... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/initial.js | modules/initial.js | import { slice } from './_setup.js';
// Returns everything but the last entry of the array. Especially useful on
// the arguments object. Passing **n** will return all the values in
// the array, excluding the last N.
export default function initial(array, n, guard) {
return slice.call(array, 0, Math.max(0, array.le... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/clone.js | modules/clone.js | import isObject from './isObject.js';
import isArray from './isArray.js';
import extend from './extend.js';
// Create a (shallow-cloned) duplicate of an object.
export default function clone(obj) {
if (!isObject(obj)) return obj;
return isArray(obj) ? obj.slice() : extend({}, obj);
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/last.js | modules/last.js | import rest from './rest.js';
// Get the last element of an array. Passing **n** will return the last N
// values in the array.
export default function last(array, n, guard) {
if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
if (n == null || guard) return array[array.length - 1];
r... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/findKey.js | modules/findKey.js | import cb from './_cb.js';
import keys from './keys.js';
// Returns the first key on an object that passes a truth test.
export default function findKey(obj, predicate, context) {
predicate = cb(predicate, context);
var _keys = keys(obj), key;
for (var i = 0, length = _keys.length; i < length; i++) {
key = _... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/reduceRight.js | modules/reduceRight.js | import createReduce from './_createReduce.js';
// The right-associative version of reduce, also known as `foldr`.
export default createReduce(-1);
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/isMatch.js | modules/isMatch.js | import keys from './keys.js';
// Returns whether an object has a given set of `key:value` pairs.
export default function isMatch(object, attrs) {
var _keys = keys(attrs), length = _keys.length;
if (object == null) return !length;
var obj = Object(object);
for (var i = 0; i < length; i++) {
var key = _keys[... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/sortBy.js | modules/sortBy.js | import cb from './_cb.js';
import pluck from './pluck.js';
import map from './map.js';
// Sort the object's values by a criterion produced by an iteratee.
export default function sortBy(obj, iteratee, context) {
var index = 0;
iteratee = cb(iteratee, context);
return pluck(map(obj, function(value, key, list) {
... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/toPath.js | modules/toPath.js | import _ from './underscore.js';
import isArray from './isArray.js';
// Normalize a (deep) property `path` to array.
// Like `_.iteratee`, this function can be customized.
export default function toPath(path) {
return isArray(path) ? path : [path];
}
_.toPath = toPath;
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/allKeys.js | modules/allKeys.js | import isObject from './isObject.js';
import { hasEnumBug } from './_setup.js';
import collectNonEnumProps from './_collectNonEnumProps.js';
// Retrieve all the enumerable property names of an object.
export default function allKeys(obj) {
if (!isObject(obj)) return [];
var keys = [];
for (var key in obj) keys.p... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/_createSizePropertyCheck.js | modules/_createSizePropertyCheck.js | import { MAX_ARRAY_INDEX } from './_setup.js';
// Common internal logic for `isArrayLike` and `isBufferLike`.
export default function createSizePropertyCheck(getSizeProperty) {
return function(collection) {
var sizeProperty = getSizeProperty(collection);
return typeof sizeProperty == 'number' && sizeProperty... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/isArray.js | modules/isArray.js | import { nativeIsArray } from './_setup.js';
import tagTester from './_tagTester.js';
// Is a given value an array?
// Delegates to ECMA5's native `Array.isArray`.
export default nativeIsArray || tagTester('Array');
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/negate.js | modules/negate.js | // Returns a negated version of the passed-in predicate.
export default function negate(predicate) {
return function() {
return !predicate.apply(this, arguments);
};
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/chunk.js | modules/chunk.js | import { slice } from './_setup.js';
// Chunk a single array into multiple arrays, each containing `count` or fewer
// items.
export default function chunk(array, count) {
if (count == null || count < 1) return [];
var result = [];
var i = 0, length = array.length;
while (i < length) {
result.push(slice.ca... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/indexOf.js | modules/indexOf.js | import sortedIndex from './sortedIndex.js';
import findIndex from './findIndex.js';
import createIndexFinder from './_createIndexFinder.js';
// Return the position of the first occurrence of an item in an array,
// or -1 if the item is not included in the array.
// If the array is large and already in sort order, pass... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/isFunction.js | modules/isFunction.js | import tagTester from './_tagTester.js';
import { root } from './_setup.js';
var isFunction = tagTester('Function');
// Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old
// v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).
var nodelist = root.document && root.document.childNodes;
i... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/underscore-array-methods.js | modules/underscore-array-methods.js | import _ from './underscore.js';
import each from './each.js';
import { ArrayProto } from './_setup.js';
import chainResult from './_chainResult.js';
// Add all mutator `Array` functions to the wrapper.
each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
var method = ArrayProto[na... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/unescape.js | modules/unescape.js | import createEscaper from './_createEscaper.js';
import unescapeMap from './_unescapeMap.js';
// Function for unescaping strings from HTML interpolation.
export default createEscaper(unescapeMap);
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/index-default.js | modules/index-default.js | // Default Export
// ==============
// In this module, we mix our bundled exports into the `_` object and export
// the result. This is analogous to setting `module.exports = _` in CommonJS.
// Hence, this module is also the entry point of our UMD bundle and the package
// entry point for CommonJS and AMD users. In oth... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/_has.js | modules/_has.js | import { hasOwnProperty } from './_setup.js';
// Internal function to check whether `key` is an own property name of `obj`.
export default function has(obj, key) {
return obj != null && hasOwnProperty.call(obj, key);
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/_tagTester.js | modules/_tagTester.js | import { toString } from './_setup.js';
// Internal function for creating a `toString`-based type tester.
export default function tagTester(name) {
var tag = '[object ' + name + ']';
return function(obj) {
return toString.call(obj) === tag;
};
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/restArguments.js | modules/restArguments.js | // Some functions take a variable number of arguments, or a few expected
// arguments at the beginning and then a variable number of values to operate
// on. This helper accumulates all remaining arguments past the function’s
// argument length (or an explicit `startIndex`), into an array that becomes
// the last argum... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/compose.js | modules/compose.js | // Returns a function that is the composition of a list of functions, each
// consuming the return value of the function that follows.
export default function compose() {
var args = arguments;
var start = args.length - 1;
return function() {
var i = start;
var result = args[start].apply(this, arguments);
... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/countBy.js | modules/countBy.js | import group from './_group.js';
import has from './_has.js';
// Counts instances of an object that group by a certain criterion. Pass
// either a string attribute to count by, or a function that returns the
// criterion.
export default group(function(result, value, key) {
if (has(result, key)) result[key]++; else r... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/isString.js | modules/isString.js | import tagTester from './_tagTester.js';
export default tagTester('String');
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/tap.js | modules/tap.js | // Invokes `interceptor` with the `obj` and then returns `obj`.
// The primary purpose of this method is to "tap into" a method chain, in
// order to perform operations on intermediate results within the chain.
export default function tap(obj, interceptor) {
interceptor(obj);
return obj;
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/_unescapeMap.js | modules/_unescapeMap.js | import invert from './invert.js';
import escapeMap from './_escapeMap.js';
// Internal list of HTML entities for unescaping.
export default invert(escapeMap);
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/intersection.js | modules/intersection.js | import getLength from './_getLength.js';
import contains from './contains.js';
// Produce an array that contains every item shared between all the
// passed-in arrays.
export default function intersection(array) {
var result = [];
var argsLength = arguments.length;
for (var i = 0, length = getLength(array); i < ... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/range.js | modules/range.js | // Generate an integer Array containing an arithmetic progression. A port of
// the native Python `range()` function. See
// [the Python documentation](https://docs.python.org/library/functions.html#range).
export default function range(start, stop, step) {
if (stop == null) {
stop = start || 0;
start = 0;
... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/isNull.js | modules/isNull.js | // Is a given value equal to null?
export default function isNull(obj) {
return obj === null;
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/object.js | modules/object.js | import getLength from './_getLength.js';
// Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values. Passing by pairs is the reverse of `_.pairs`.
export default function object(list, values) {... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/where.js | modules/where.js | import filter from './filter.js';
import matcher from './matcher.js';
// Convenience version of a common use case of `_.filter`: selecting only
// objects containing specific `key:value` pairs.
export default function where(obj, attrs) {
return filter(obj, matcher(attrs));
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/isObject.js | modules/isObject.js | // Is a given variable an object?
export default function isObject(obj) {
var type = typeof obj;
return type === 'function' || (type === 'object' && !!obj);
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/times.js | modules/times.js | import optimizeCb from './_optimizeCb.js';
// Run a function **n** times.
export default function times(n, iteratee, context) {
var accum = Array(Math.max(0, n));
iteratee = optimizeCb(iteratee, context, 1);
for (var i = 0; i < n; i++) accum[i] = iteratee(i);
return accum;
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/_toPath.js | modules/_toPath.js | import _ from './underscore.js';
import './toPath.js';
// Internal wrapper for `_.toPath` to enable minification.
// Similar to `cb` for `_.iteratee`.
export default function toPath(path) {
return _.toPath(path);
}
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/findLastIndex.js | modules/findLastIndex.js | import createPredicateIndexFinder from './_createPredicateIndexFinder.js';
// Returns the last index on an array-like that passes a truth test.
export default createPredicateIndexFinder(-1);
| javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
jashkenas/underscore | https://github.com/jashkenas/underscore/blob/0d820ef7292cdec28dd8b5d565921b8100ca3397/modules/every.js | modules/every.js | import cb from './_cb.js';
import isArrayLike from './_isArrayLike.js';
import keys from './keys.js';
// Determine whether all of the elements pass a truth test.
export default function every(obj, predicate, context) {
predicate = cb(predicate, context);
var _keys = !isArrayLike(obj) && keys(obj),
length = (... | javascript | MIT | 0d820ef7292cdec28dd8b5d565921b8100ca3397 | 2026-01-04T15:02:30.228892Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.