Added the underscore node_module.
All checks were successful
Auto Maintenance Cycle / pre-commit Autoupdate (push) Successful in 39s

This commit is contained in:
2023-11-19 13:27:05 +01:00
parent 9e76cefde3
commit 2b58149655
857 changed files with 16626 additions and 105549 deletions

21
node_modules/underscore/modules/.eslintrc generated vendored Normal file
View File

@ -0,0 +1,21 @@
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
},
"plugins": [
"import"
],
"extends": [
"plugin:import/errors"
],
"rules": {
// ExtendScript wrongly gives equal precedence to && and ||. #2949
"no-mixed-operators": [
"error",
{
"groups": [["&&", "||"]]
}
]
}
}

18
node_modules/underscore/modules/_baseCreate.js generated vendored Normal file
View File

@ -0,0 +1,18 @@
import isObject from './isObject.js';
import { nativeCreate } from './_setup.js';
// Create a naked function reference for surrogate-prototype-swapping.
function ctor() {
return function(){};
}
// An internal function for creating a new object that inherits from another.
export default function baseCreate(prototype) {
if (!isObject(prototype)) return {};
if (nativeCreate) return nativeCreate(prototype);
var Ctor = ctor();
Ctor.prototype = prototype;
var result = new Ctor;
Ctor.prototype = null;
return result;
}

17
node_modules/underscore/modules/_baseIteratee.js generated vendored Normal file
View File

@ -0,0 +1,17 @@
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 that can be applied to each
// element in a collection, returning the desired result — either `_.identity`,
// an arbitrary callback, a property matcher, or a property accessor.
export default function baseIteratee(value, context, argCount) {
if (value == null) return identity;
if (isFunction(value)) return optimizeCb(value, context, argCount);
if (isObject(value) && !isArray(value)) return matcher(value);
return property(value);
}

10
node_modules/underscore/modules/_cb.js generated vendored Normal file
View File

@ -0,0 +1,10 @@
import _ from './underscore.js';
import baseIteratee from './_baseIteratee.js';
import iteratee from './iteratee.js';
// The function we call internally to generate a callback. It invokes
// `_.iteratee` if overridden, otherwise `baseIteratee`.
export default function cb(value, context, argCount) {
if (_.iteratee !== iteratee) return _.iteratee(value, context);
return baseIteratee(value, context, argCount);
}

6
node_modules/underscore/modules/_chainResult.js generated vendored Normal file
View File

@ -0,0 +1,6 @@
import _ from './underscore.js';
// Helper function to continue chaining intermediate results.
export default function chainResult(instance, obj) {
return instance._chain ? _(obj).chain() : obj;
}

View File

@ -0,0 +1,40 @@
import { nonEnumerableProps, ObjProto } from './_setup.js';
import isFunction from './isFunction.js';
import has from './_has.js';
// Internal helper to create a simple lookup structure.
// `collectNonEnumProps` used to depend on `_.contains`, but this led to
// circular imports. `emulatedSet` is a one-off solution that only works for
// arrays of strings.
function emulatedSet(keys) {
var hash = {};
for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;
return {
contains: function(key) { return hash[key] === true; },
push: function(key) {
hash[key] = true;
return keys.push(key);
}
};
}
// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't
// be iterated by `for key in ...` and thus missed. Extends `keys` in place if
// needed.
export default function collectNonEnumProps(obj, keys) {
keys = emulatedSet(keys);
var nonEnumIdx = nonEnumerableProps.length;
var constructor = obj.constructor;
var proto = (isFunction(constructor) && constructor.prototype) || ObjProto;
// Constructor is a special case.
var prop = 'constructor';
if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);
while (nonEnumIdx--) {
prop = nonEnumerableProps[nonEnumIdx];
if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {
keys.push(prop);
}
}
}

18
node_modules/underscore/modules/_createAssigner.js generated vendored Normal file
View File

@ -0,0 +1,18 @@
// An internal function for creating assigner functions.
export default function createAssigner(keysFunc, defaults) {
return function(obj) {
var length = arguments.length;
if (defaults) obj = Object(obj);
if (length < 2 || obj == null) return obj;
for (var index = 1; index < length; index++) {
var source = arguments[index],
keys = keysFunc(source),
l = keys.length;
for (var i = 0; i < l; i++) {
var key = keys[i];
if (!defaults || obj[key] === void 0) obj[key] = source[key];
}
}
return obj;
};
}

17
node_modules/underscore/modules/_createEscaper.js generated vendored Normal file
View File

@ -0,0 +1,17 @@
import keys from './keys.js';
// Internal helper to generate functions for escaping and unescaping strings
// to/from HTML interpolation.
export default function createEscaper(map) {
var escaper = function(match) {
return map[match];
};
// Regexes for identifying a key that needs to be escaped.
var source = '(?:' + keys(map).join('|') + ')';
var testRegexp = RegExp(source);
var replaceRegexp = RegExp(source, 'g');
return function(string) {
string = string == null ? '' : '' + string;
return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
};
}

28
node_modules/underscore/modules/_createIndexFinder.js generated vendored Normal file
View File

@ -0,0 +1,28 @@
import getLength from './_getLength.js';
import { slice } from './_setup.js';
import isNaN from './isNaN.js';
// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.
export default function createIndexFinder(dir, predicateFind, sortedIndex) {
return function(array, item, idx) {
var i = 0, length = getLength(array);
if (typeof idx == 'number') {
if (dir > 0) {
i = idx >= 0 ? idx : Math.max(idx + length, i);
} else {
length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
}
} else if (sortedIndex && idx && length) {
idx = sortedIndex(array, item);
return array[idx] === item ? idx : -1;
}
if (item !== item) {
idx = predicateFind(slice.call(array, i, length), isNaN);
return idx >= 0 ? idx + i : -1;
}
for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
if (array[idx] === item) return idx;
}
return -1;
};
}

View File

@ -0,0 +1,15 @@
import cb from './_cb.js';
import getLength from './_getLength.js';
// Internal function to generate `_.findIndex` and `_.findLastIndex`.
export default function createPredicateIndexFinder(dir) {
return function(array, predicate, context) {
predicate = cb(predicate, context);
var length = getLength(array);
var index = dir > 0 ? 0 : length - 1;
for (; index >= 0 && index < length; index += dir) {
if (predicate(array[index], index, array)) return index;
}
return -1;
};
}

28
node_modules/underscore/modules/_createReduce.js generated vendored Normal file
View File

@ -0,0 +1,28 @@
import isArrayLike from './_isArrayLike.js';
import keys from './keys.js';
import optimizeCb from './_optimizeCb.js';
// Internal helper to create a reducing function, iterating left or right.
export default function createReduce(dir) {
// Wrap code that reassigns argument variables in a separate function than
// the one that accesses `arguments.length` to avoid a perf hit. (#1991)
var reducer = function(obj, iteratee, memo, initial) {
var _keys = !isArrayLike(obj) && keys(obj),
length = (_keys || obj).length,
index = dir > 0 ? 0 : length - 1;
if (!initial) {
memo = obj[_keys ? _keys[index] : index];
index += dir;
}
for (; index >= 0 && index < length; index += dir) {
var currentKey = _keys ? _keys[index] : index;
memo = iteratee(memo, obj[currentKey], currentKey, obj);
}
return memo;
};
return function(obj, iteratee, memo, context) {
var initial = arguments.length >= 3;
return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);
};
}

View File

@ -0,0 +1,9 @@
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 >= 0 && sizeProperty <= MAX_ARRAY_INDEX;
}
}

9
node_modules/underscore/modules/_deepGet.js generated vendored Normal file
View File

@ -0,0 +1,9 @@
// Internal function to obtain a nested property in `obj` along `path`.
export default function deepGet(obj, path) {
var length = path.length;
for (var i = 0; i < length; i++) {
if (obj == null) return void 0;
obj = obj[path[i]];
}
return length ? obj : void 0;
}

9
node_modules/underscore/modules/_escapeMap.js generated vendored Normal file
View File

@ -0,0 +1,9 @@
// Internal list of HTML entities for escaping.
export default {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#x27;',
'`': '&#x60;'
};

13
node_modules/underscore/modules/_executeBound.js generated vendored Normal file
View File

@ -0,0 +1,13 @@
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, context, callingContext, args) {
if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
var self = baseCreate(sourceFunc.prototype);
var result = sourceFunc.apply(self, args);
if (isObject(result)) return result;
return self;
}

31
node_modules/underscore/modules/_flatten.js generated vendored Normal file
View File

@ -0,0 +1,31 @@
import getLength from './_getLength.js';
import isArrayLike from './_isArrayLike.js';
import isArray from './isArray.js';
import isArguments from './isArguments.js';
// Internal implementation of a recursive `flatten` function.
export default function flatten(input, depth, strict, output) {
output = output || [];
if (!depth && depth !== 0) {
depth = Infinity;
} else if (depth <= 0) {
return output.concat(input);
}
var idx = output.length;
for (var i = 0, length = getLength(input); i < length; i++) {
var value = input[i];
if (isArrayLike(value) && (isArray(value) || isArguments(value))) {
// Flatten current level of array or arguments object.
if (depth > 1) {
flatten(value, depth - 1, strict, output);
idx = output.length;
} else {
var j = 0, len = value.length;
while (j < len) output[idx++] = value[j++];
}
} else if (!strict) {
output[idx++] = value;
}
}
return output;
}

4
node_modules/underscore/modules/_getByteLength.js generated vendored Normal file
View File

@ -0,0 +1,4 @@
import shallowProperty from './_shallowProperty.js';
// Internal helper to obtain the `byteLength` property of an object.
export default shallowProperty('byteLength');

4
node_modules/underscore/modules/_getLength.js generated vendored Normal file
View File

@ -0,0 +1,4 @@
import shallowProperty from './_shallowProperty.js';
// Internal helper to obtain the `length` property of an object.
export default shallowProperty('length');

15
node_modules/underscore/modules/_group.js generated vendored Normal file
View File

@ -0,0 +1,15 @@
import cb from './_cb.js';
import each from './each.js';
// An internal function used for aggregate "group by" operations.
export default function group(behavior, partition) {
return function(obj, iteratee, context) {
var result = partition ? [[], []] : {};
iteratee = cb(iteratee, context);
each(obj, function(value, index) {
var key = iteratee(value, index, obj);
behavior(result, value, key);
});
return result;
};
}

6
node_modules/underscore/modules/_has.js generated vendored Normal file
View File

@ -0,0 +1,6 @@
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);
}

3
node_modules/underscore/modules/_hasObjectTag.js generated vendored Normal file
View File

@ -0,0 +1,3 @@
import tagTester from './_tagTester.js';
export default tagTester('Object');

8
node_modules/underscore/modules/_isArrayLike.js generated vendored Normal file
View File

@ -0,0 +1,8 @@
import createSizePropertyCheck from './_createSizePropertyCheck.js';
import getLength from './_getLength.js';
// Internal helper for collection methods to determine whether a collection
// should be iterated as an array or as an object.
// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
export default createSizePropertyCheck(getLength);

6
node_modules/underscore/modules/_isBufferLike.js generated vendored Normal file
View File

@ -0,0 +1,6 @@
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);

5
node_modules/underscore/modules/_keyInObj.js generated vendored Normal file
View File

@ -0,0 +1,5 @@
// Internal `_.pick` helper function to determine whether `key` is an enumerable
// property name of `obj`.
export default function keyInObj(value, key, obj) {
return key in obj;
}

37
node_modules/underscore/modules/_methodFingerprint.js generated vendored Normal file
View File

@ -0,0 +1,37 @@
import getLength from './_getLength.js';
import isFunction from './isFunction.js';
import allKeys from './allKeys.js';
// Since the regular `Object.prototype.toString` type tests don't work for
// some types in IE 11, we use a fingerprinting heuristic instead, based
// on the methods. It's not great, but it's the best we got.
// The fingerprint method lists are defined below.
export function ie11fingerprint(methods) {
var length = getLength(methods);
return function(obj) {
if (obj == null) return false;
// `Map`, `WeakMap` and `Set` have no enumerable keys.
var keys = allKeys(obj);
if (getLength(keys)) return false;
for (var i = 0; i < length; i++) {
if (!isFunction(obj[methods[i]])) return false;
}
// If we are testing against `WeakMap`, we need to ensure that
// `obj` doesn't have a `forEach` method in order to distinguish
// it from a regular `Map`.
return methods !== weakMapMethods || !isFunction(obj[forEachName]);
};
}
// In the interest of compact minification, we write
// each string in the fingerprints only once.
var forEachName = 'forEach',
hasName = 'has',
commonInit = ['clear', 'delete'],
mapTail = ['get', hasName, 'set'];
// `Map`, `WeakMap` and `Set` each have slightly different
// combinations of the above sublists.
export var mapMethods = commonInit.concat(forEachName, mapTail),
weakMapMethods = commonInit.concat(mapTail),
setMethods = ['add'].concat(commonInit, forEachName, hasName);

21
node_modules/underscore/modules/_optimizeCb.js generated vendored Normal file
View File

@ -0,0 +1,21 @@
// 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 1: return function(value) {
return func.call(context, value);
};
// The 2-argument case is omitted because were not using it.
case 3: return function(value, index, collection) {
return func.call(context, value, index, collection);
};
case 4: return function(accumulator, value, index, collection) {
return func.call(context, accumulator, value, index, collection);
};
}
return function() {
return func.apply(context, arguments);
};
}

43
node_modules/underscore/modules/_setup.js generated vendored Normal file
View File

@ -0,0 +1,43 @@
// Current version.
export var VERSION = '1.13.6';
// Establish the root object, `window` (`self`) in the browser, `global`
// on the server, or `this` in some virtual machines. We use `self`
// instead of `window` for `WebWorker` support.
export var root = (typeof self == 'object' && self.self === self && self) ||
(typeof global == 'object' && global.global === global && global) ||
Function('return this')() ||
{};
// Save bytes in the minified (but not gzipped) version:
export var ArrayProto = Array.prototype, ObjProto = Object.prototype;
export var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;
// Create quick reference variables for speed access to core prototypes.
export var push = ArrayProto.push,
slice = ArrayProto.slice,
toString = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty;
// Modern feature detection.
export var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined',
supportsDataView = typeof DataView !== 'undefined';
// All **ECMAScript 5+** native function implementations that we hope to use
// are declared here.
export var nativeIsArray = Array.isArray,
nativeKeys = Object.keys,
nativeCreate = Object.create,
nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;
// Create references to these builtin functions because we override them.
export var _isNaN = isNaN,
_isFinite = isFinite;
// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
export var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
export var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
// The largest integer that can be represented exactly.
export var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;

6
node_modules/underscore/modules/_shallowProperty.js generated vendored Normal file
View File

@ -0,0 +1,6 @@
// Internal helper to generate a function to obtain property `key` from `obj`.
export default function shallowProperty(key) {
return function(obj) {
return obj == null ? void 0 : obj[key];
};
}

10
node_modules/underscore/modules/_stringTagBug.js generated vendored Normal file
View File

@ -0,0 +1,10 @@
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`.
export var hasStringTagBug = (
supportsDataView && hasObjectTag(new DataView(new ArrayBuffer(8)))
),
isIE11 = (typeof Map !== 'undefined' && hasObjectTag(new Map));

9
node_modules/underscore/modules/_tagTester.js generated vendored Normal file
View File

@ -0,0 +1,9 @@
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;
};
}

11
node_modules/underscore/modules/_toBufferView.js generated vendored Normal file
View File

@ -0,0 +1,11 @@
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 || 0,
getByteLength(bufferSource)
);
}

8
node_modules/underscore/modules/_toPath.js generated vendored Normal file
View File

@ -0,0 +1,8 @@
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);
}

5
node_modules/underscore/modules/_unescapeMap.js generated vendored Normal file
View File

@ -0,0 +1,5 @@
import invert from './invert.js';
import escapeMap from './_escapeMap.js';
// Internal list of HTML entities for unescaping.
export default invert(escapeMap);

8
node_modules/underscore/modules/after.js generated vendored Normal file
View File

@ -0,0 +1,8 @@
// 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);
}
};
}

13
node_modules/underscore/modules/allKeys.js generated vendored Normal file
View File

@ -0,0 +1,13 @@
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.push(key);
// Ahem, IE < 9.
if (hasEnumBug) collectNonEnumProps(obj, keys);
return keys;
}

12
node_modules/underscore/modules/before.js generated vendored Normal file
View File

@ -0,0 +1,12 @@
// Returns a function that will only be executed up to (but not including) the
// Nth call.
export default function before(times, func) {
var memo;
return function() {
if (--times > 0) {
memo = func.apply(this, arguments);
}
if (times <= 1) func = null;
return memo;
};
}

13
node_modules/underscore/modules/bind.js generated vendored Normal file
View File

@ -0,0 +1,13 @@
import restArguments from './restArguments.js';
import isFunction from './isFunction.js';
import executeBound from './_executeBound.js';
// Create a function bound to a given object (assigning `this`, and arguments,
// optionally).
export default restArguments(function(func, context, args) {
if (!isFunction(func)) throw new TypeError('Bind must be called on a function');
var bound = restArguments(function(callArgs) {
return executeBound(func, bound, context, this, args.concat(callArgs));
});
return bound;
});

17
node_modules/underscore/modules/bindAll.js generated vendored Normal file
View File

@ -0,0 +1,17 @@
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 restArguments(function(obj, keys) {
keys = flatten(keys, false, false);
var index = keys.length;
if (index < 1) throw new Error('bindAll must be passed function names');
while (index--) {
var key = keys[index];
obj[key] = bind(obj[key], obj);
}
return obj;
});

8
node_modules/underscore/modules/chain.js generated vendored Normal file
View File

@ -0,0 +1,8 @@
import _ from './underscore.js';
// Start chaining a wrapped Underscore object.
export default function chain(obj) {
var instance = _(obj);
instance._chain = true;
return instance;
}

13
node_modules/underscore/modules/chunk.js generated vendored Normal file
View File

@ -0,0 +1,13 @@
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.call(array, i, i += count));
}
return result;
}

9
node_modules/underscore/modules/clone.js generated vendored Normal file
View File

@ -0,0 +1,9 @@
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);
}

6
node_modules/underscore/modules/compact.js generated vendored Normal file
View File

@ -0,0 +1,6 @@
import filter from './filter.js';
// Trim out all falsy values from an array.
export default function compact(array) {
return filter(array, Boolean);
}

12
node_modules/underscore/modules/compose.js generated vendored Normal file
View File

@ -0,0 +1,12 @@
// 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);
while (i--) result = args[i].call(this, result);
return result;
};
}

6
node_modules/underscore/modules/constant.js generated vendored Normal file
View File

@ -0,0 +1,6 @@
// Predicate-generating function. Often useful outside of Underscore.
export default function constant(value) {
return function() {
return value;
};
}

10
node_modules/underscore/modules/contains.js generated vendored Normal file
View File

@ -0,0 +1,10 @@
import isArrayLike from './_isArrayLike.js';
import values from './values.js';
import indexOf from './indexOf.js';
// Determine if the array or object contains a given item (using `===`).
export default function contains(obj, item, fromIndex, guard) {
if (!isArrayLike(obj)) obj = values(obj);
if (typeof fromIndex != 'number' || guard) fromIndex = 0;
return indexOf(obj, item, fromIndex) >= 0;
}

9
node_modules/underscore/modules/countBy.js generated vendored Normal file
View File

@ -0,0 +1,9 @@
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 result[key] = 1;
});

11
node_modules/underscore/modules/create.js generated vendored Normal file
View File

@ -0,0 +1,11 @@
import baseCreate from './_baseCreate.js';
import extendOwn from './extendOwn.js';
// Creates an object that inherits from the given prototype object.
// If additional properties are provided then they will be added to the
// created object.
export default function create(prototype, props) {
var result = baseCreate(prototype);
if (props) extendOwn(result, props);
return result;
}

40
node_modules/underscore/modules/debounce.js generated vendored Normal file
View File

@ -0,0 +1,40 @@
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 beginning of the sequence instead of at the end.
export default function debounce(func, wait, immediate) {
var timeout, previous, args, result, context;
var later = function() {
var passed = now() - previous;
if (wait > passed) {
timeout = setTimeout(later, wait - passed);
} else {
timeout = null;
if (!immediate) result = func.apply(context, args);
// This check is needed because `func` can recursively invoke `debounced`.
if (!timeout) args = context = null;
}
};
var debounced = restArguments(function(_args) {
context = this;
args = _args;
previous = now();
if (!timeout) {
timeout = setTimeout(later, wait);
if (immediate) result = func.apply(context, args);
}
return result;
});
debounced.cancel = function() {
clearTimeout(timeout);
timeout = args = context = null;
};
return debounced;
}

5
node_modules/underscore/modules/defaults.js generated vendored Normal file
View File

@ -0,0 +1,5 @@
import createAssigner from './_createAssigner.js';
import allKeys from './allKeys.js';
// Fill in a given object with default properties.
export default createAssigner(allKeys, true);

7
node_modules/underscore/modules/defer.js generated vendored Normal file
View File

@ -0,0 +1,7 @@
import partial from './partial.js';
import delay from './delay.js';
import _ from './underscore.js';
// Defers a function, scheduling it to run after the current call stack has
// cleared.
export default partial(delay, _, 1);

9
node_modules/underscore/modules/delay.js generated vendored Normal file
View File

@ -0,0 +1,9 @@
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);
});

13
node_modules/underscore/modules/difference.js generated vendored Normal file
View File

@ -0,0 +1,13 @@
import restArguments from './restArguments.js';
import flatten from './_flatten.js';
import filter from './filter.js';
import contains from './contains.js';
// Take the difference between one array and a number of other arrays.
// Only the elements present in just the first array will remain.
export default restArguments(function(array, rest) {
rest = flatten(rest, true, true);
return filter(array, function(value){
return !contains(rest, value);
});
});

23
node_modules/underscore/modules/each.js generated vendored Normal file
View File

@ -0,0 +1,23 @@
import optimizeCb from './_optimizeCb.js';
import isArrayLike from './_isArrayLike.js';
import keys from './keys.js';
// The cornerstone for collection functions, an `each`
// implementation, aka `forEach`.
// Handles raw objects in addition to array-likes. Treats all
// sparse array-likes as if they were dense.
export default function each(obj, iteratee, context) {
iteratee = optimizeCb(iteratee, context);
var i, length;
if (isArrayLike(obj)) {
for (i = 0, length = obj.length; i < length; i++) {
iteratee(obj[i], i, obj);
}
} else {
var _keys = keys(obj);
for (i = 0, length = _keys.length; i < length; i++) {
iteratee(obj[_keys[i]], _keys[i], obj);
}
}
return obj;
}

5
node_modules/underscore/modules/escape.js generated vendored Normal file
View File

@ -0,0 +1,5 @@
import createEscaper from './_createEscaper.js';
import escapeMap from './_escapeMap.js';
// Function for escaping strings to HTML interpolation.
export default createEscaper(escapeMap);

15
node_modules/underscore/modules/every.js generated vendored Normal file
View File

@ -0,0 +1,15 @@
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 = (_keys || obj).length;
for (var index = 0; index < length; index++) {
var currentKey = _keys ? _keys[index] : index;
if (!predicate(obj[currentKey], currentKey, obj)) return false;
}
return true;
}

5
node_modules/underscore/modules/extend.js generated vendored Normal file
View File

@ -0,0 +1,5 @@
import createAssigner from './_createAssigner.js';
import allKeys from './allKeys.js';
// Extend a given object with all the properties in passed-in object(s).
export default createAssigner(allKeys);

7
node_modules/underscore/modules/extendOwn.js generated vendored Normal file
View File

@ -0,0 +1,7 @@
import createAssigner from './_createAssigner.js';
import keys from './keys.js';
// Assigns a given object with all the own properties in the passed-in
// object(s).
// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
export default createAssigner(keys);

12
node_modules/underscore/modules/filter.js generated vendored Normal file
View File

@ -0,0 +1,12 @@
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(value);
});
return results;
}

10
node_modules/underscore/modules/find.js generated vendored Normal file
View File

@ -0,0 +1,10 @@
import isArrayLike from './_isArrayLike.js';
import findIndex from './findIndex.js';
import findKey from './findKey.js';
// Return the first value which passes a truth test.
export default function find(obj, predicate, context) {
var keyFinder = isArrayLike(obj) ? findIndex : findKey;
var key = keyFinder(obj, predicate, context);
if (key !== void 0 && key !== -1) return obj[key];
}

4
node_modules/underscore/modules/findIndex.js generated vendored Normal file
View File

@ -0,0 +1,4 @@
import createPredicateIndexFinder from './_createPredicateIndexFinder.js';
// Returns the first index on an array-like that passes a truth test.
export default createPredicateIndexFinder(1);

12
node_modules/underscore/modules/findKey.js generated vendored Normal file
View File

@ -0,0 +1,12 @@
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 = _keys[i];
if (predicate(obj[key], key, obj)) return key;
}
}

4
node_modules/underscore/modules/findLastIndex.js generated vendored Normal file
View File

@ -0,0 +1,4 @@
import createPredicateIndexFinder from './_createPredicateIndexFinder.js';
// Returns the last index on an array-like that passes a truth test.
export default createPredicateIndexFinder(-1);

8
node_modules/underscore/modules/findWhere.js generated vendored Normal file
View File

@ -0,0 +1,8 @@
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));
}

9
node_modules/underscore/modules/first.js generated vendored Normal file
View File

@ -0,0 +1,9 @@
import initial from './initial.js';
// Get the first element of an array. Passing **n** will return the first N
// values in the array. The **guard** check allows it to work with `_.map`.
export default function first(array, n, guard) {
if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
if (n == null || guard) return array[0];
return initial(array, array.length - n);
}

7
node_modules/underscore/modules/flatten.js generated vendored Normal file
View File

@ -0,0 +1,7 @@
import _flatten from './_flatten.js';
// Flatten out an array, either recursively (by default), or up to `depth`.
// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.
export default function flatten(array, depth) {
return _flatten(array, depth, false);
}

10
node_modules/underscore/modules/functions.js generated vendored Normal file
View File

@ -0,0 +1,10 @@
import isFunction from './isFunction.js';
// Return a sorted list of the function names available on the object.
export default function functions(obj) {
var names = [];
for (var key in obj) {
if (isFunction(obj[key])) names.push(key);
}
return names.sort();
}

12
node_modules/underscore/modules/get.js generated vendored Normal file
View File

@ -0,0 +1,12 @@
import toPath from './_toPath.js';
import deepGet from './_deepGet.js';
import isUndefined from './isUndefined.js';
// Get the value of the (deep) property on `path` from `object`.
// If any property in `path` does not exist or if the value is
// `undefined`, return `defaultValue` instead.
// The `path` is normalized through `_.toPath`.
export default function get(object, path, defaultValue) {
var value = deepGet(object, toPath(path));
return isUndefined(value) ? defaultValue : value;
}

8
node_modules/underscore/modules/groupBy.js generated vendored Normal file
View File

@ -0,0 +1,8 @@
import group from './_group.js';
import has from './_has.js';
// Groups the object's values by a criterion. Pass either a string attribute
// to group by, or a function that returns the criterion.
export default group(function(result, value, key) {
if (has(result, key)) result[key].push(value); else result[key] = [value];
});

16
node_modules/underscore/modules/has.js generated vendored Normal file
View File

@ -0,0 +1,16 @@
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(obj, path) {
path = toPath(path);
var length = path.length;
for (var i = 0; i < length; i++) {
var key = path[i];
if (!_has(obj, key)) return false;
obj = obj[key];
}
return !!length;
}

4
node_modules/underscore/modules/identity.js generated vendored Normal file
View File

@ -0,0 +1,4 @@
// Keep the identity function around for default iteratees.
export default function identity(value) {
return value;
}

18
node_modules/underscore/modules/index-all.js generated vendored Normal file
View File

@ -0,0 +1,18 @@
// ESM Exports
// ===========
// This module is the package entry point for ES module users. In other words,
// it is the module they are interfacing with when they import from the whole
// package instead of from a submodule, like this:
//
// ```js
// import { map } from 'underscore';
// ```
//
// The difference with `./index-default`, which is the package entry point for
// CommonJS, AMD and UMD users, is purely technical. In ES modules, named and
// default exports are considered to be siblings, so when you have a default
// export, its properties are not automatically available as named exports. For
// this reason, we re-export the named exports in addition to providing the same
// default export as in `./index-default`.
export { default } from './index-default.js';
export * from './index.js';

27
node_modules/underscore/modules/index-default.js generated vendored Normal file
View File

@ -0,0 +1,27 @@
// 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 other words, this is (the source
// of) the module you are interfacing with when you do any of the following:
//
// ```js
// // CommonJS
// var _ = require('underscore');
//
// // AMD
// define(['underscore'], function(_) {...});
//
// // UMD in the browser
// // _ is available as a global variable
// ```
import * as allExports from './index.js';
import { mixin } from './index.js';
// Add all of the Underscore functions to the wrapper object.
var _ = mixin(allExports);
// Legacy Node.js API.
_._ = _;
// Export the Underscore API.
export default _;

200
node_modules/underscore/modules/index.js generated vendored Normal file
View File

@ -0,0 +1,200 @@
// Named Exports
// =============
// Underscore.js 1.13.6
// https://underscorejs.org
// (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
// Baseline setup.
export { VERSION } from './_setup.js';
export { default as restArguments } from './restArguments.js';
// Object Functions
// ----------------
// Our most fundamental functions operate on any JavaScript object.
// Most functions in Underscore depend on at least one function in this section.
// A group of functions that check the types of core JavaScript values.
// These are often informally referred to as the "isType" functions.
export { default as isObject } from './isObject.js';
export { default as isNull } from './isNull.js';
export { default as isUndefined } from './isUndefined.js';
export { default as isBoolean } from './isBoolean.js';
export { default as isElement } from './isElement.js';
export { default as isString } from './isString.js';
export { default as isNumber } from './isNumber.js';
export { default as isDate } from './isDate.js';
export { default as isRegExp } from './isRegExp.js';
export { default as isError } from './isError.js';
export { default as isSymbol } from './isSymbol.js';
export { default as isArrayBuffer } from './isArrayBuffer.js';
export { default as isDataView } from './isDataView.js';
export { default as isArray } from './isArray.js';
export { default as isFunction } from './isFunction.js';
export { default as isArguments } from './isArguments.js';
export { default as isFinite } from './isFinite.js';
export { default as isNaN } from './isNaN.js';
export { default as isTypedArray } from './isTypedArray.js';
export { default as isEmpty } from './isEmpty.js';
export { default as isMatch } from './isMatch.js';
export { default as isEqual } from './isEqual.js';
export { default as isMap } from './isMap.js';
export { default as isWeakMap } from './isWeakMap.js';
export { default as isSet } from './isSet.js';
export { default as isWeakSet } from './isWeakSet.js';
// Functions that treat an object as a dictionary of key-value pairs.
export { default as keys } from './keys.js';
export { default as allKeys } from './allKeys.js';
export { default as values } from './values.js';
export { default as pairs } from './pairs.js';
export { default as invert } from './invert.js';
export { default as functions,
default as methods } from './functions.js';
export { default as extend } from './extend.js';
export { default as extendOwn,
default as assign } from './extendOwn.js';
export { default as defaults } from './defaults.js';
export { default as create } from './create.js';
export { default as clone } from './clone.js';
export { default as tap } from './tap.js';
export { default as get } from './get.js';
export { default as has } from './has.js';
export { default as mapObject } from './mapObject.js';
// Utility Functions
// -----------------
// A bit of a grab bag: Predicate-generating functions for use with filters and
// loops, string escaping and templating, create random numbers and unique ids,
// and functions that facilitate Underscore's chaining and iteration conventions.
export { default as identity } from './identity.js';
export { default as constant } from './constant.js';
export { default as noop } from './noop.js';
export { default as toPath } from './toPath.js';
export { default as property } from './property.js';
export { default as propertyOf } from './propertyOf.js';
export { default as matcher,
default as matches } from './matcher.js';
export { default as times } from './times.js';
export { default as random } from './random.js';
export { default as now } from './now.js';
export { default as escape } from './escape.js';
export { default as unescape } from './unescape.js';
export { default as templateSettings } from './templateSettings.js';
export { default as template } from './template.js';
export { default as result } from './result.js';
export { default as uniqueId } from './uniqueId.js';
export { default as chain } from './chain.js';
export { default as iteratee } from './iteratee.js';
// Function (ahem) Functions
// -------------------------
// These functions take a function as an argument and return a new function
// as the result. Also known as higher-order functions.
export { default as partial } from './partial.js';
export { default as bind } from './bind.js';
export { default as bindAll } from './bindAll.js';
export { default as memoize } from './memoize.js';
export { default as delay } from './delay.js';
export { default as defer } from './defer.js';
export { default as throttle } from './throttle.js';
export { default as debounce } from './debounce.js';
export { default as wrap } from './wrap.js';
export { default as negate } from './negate.js';
export { default as compose } from './compose.js';
export { default as after } from './after.js';
export { default as before } from './before.js';
export { default as once } from './once.js';
// Finders
// -------
// Functions that extract (the position of) a single element from an object
// or array based on some criterion.
export { default as findKey } from './findKey.js';
export { default as findIndex } from './findIndex.js';
export { default as findLastIndex } from './findLastIndex.js';
export { default as sortedIndex } from './sortedIndex.js';
export { default as indexOf } from './indexOf.js';
export { default as lastIndexOf } from './lastIndexOf.js';
export { default as find,
default as detect } from './find.js';
export { default as findWhere } from './findWhere.js';
// Collection Functions
// --------------------
// Functions that work on any collection of elements: either an array, or
// an object of key-value pairs.
export { default as each,
default as forEach } from './each.js';
export { default as map,
default as collect } from './map.js';
export { default as reduce,
default as foldl,
default as inject } from './reduce.js';
export { default as reduceRight,
default as foldr } from './reduceRight.js';
export { default as filter,
default as select } from './filter.js';
export { default as reject } from './reject.js';
export { default as every,
default as all } from './every.js';
export { default as some,
default as any } from './some.js';
export { default as contains,
default as includes,
default as include } from './contains.js';
export { default as invoke } from './invoke.js';
export { default as pluck } from './pluck.js';
export { default as where } from './where.js';
export { default as max } from './max.js';
export { default as min } from './min.js';
export { default as shuffle } from './shuffle.js';
export { default as sample } from './sample.js';
export { default as sortBy } from './sortBy.js';
export { default as groupBy } from './groupBy.js';
export { default as indexBy } from './indexBy.js';
export { default as countBy } from './countBy.js';
export { default as partition } from './partition.js';
export { default as toArray } from './toArray.js';
export { default as size } from './size.js';
// `_.pick` and `_.omit` are actually object functions, but we put
// them here in order to create a more natural reading order in the
// monolithic build as they depend on `_.contains`.
export { default as pick } from './pick.js';
export { default as omit } from './omit.js';
// Array Functions
// ---------------
// Functions that operate on arrays (and array-likes) only, because theyre
// expressed in terms of operations on an ordered list of values.
export { default as first,
default as head,
default as take } from './first.js';
export { default as initial } from './initial.js';
export { default as last } from './last.js';
export { default as rest,
default as tail,
default as drop } from './rest.js';
export { default as compact } from './compact.js';
export { default as flatten } from './flatten.js';
export { default as without } from './without.js';
export { default as uniq,
default as unique } from './uniq.js';
export { default as union } from './union.js';
export { default as intersection } from './intersection.js';
export { default as difference } from './difference.js';
export { default as unzip,
default as transpose } from './unzip.js';
export { default as zip } from './zip.js';
export { default as object } from './object.js';
export { default as range } from './range.js';
export { default as chunk } from './chunk.js';
// OOP
// ---
// These modules support the "object-oriented" calling style. See also
// `underscore.js` and `index-default.js`.
export { default as mixin } from './mixin.js';
export { default } from './underscore-array-methods.js';

7
node_modules/underscore/modules/indexBy.js generated vendored Normal file
View File

@ -0,0 +1,7 @@
import group from './_group.js';
// Indexes the object's values by a criterion, similar to `_.groupBy`, but for
// when you know that your index values will be unique.
export default group(function(result, value, key) {
result[key] = value;
});

9
node_modules/underscore/modules/indexOf.js generated vendored Normal file
View File

@ -0,0 +1,9 @@
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 `true`
// for **isSorted** to use binary search.
export default createIndexFinder(1, findIndex, sortedIndex);

8
node_modules/underscore/modules/initial.js generated vendored Normal file
View File

@ -0,0 +1,8 @@
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.length - (n == null || guard ? 1 : n)));
}

19
node_modules/underscore/modules/intersection.js generated vendored Normal file
View File

@ -0,0 +1,19 @@
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 < length; i++) {
var item = array[i];
if (contains(result, item)) continue;
var j;
for (j = 1; j < argsLength; j++) {
if (!contains(arguments[j], item)) break;
}
if (j === argsLength) result.push(item);
}
return result;
}

11
node_modules/underscore/modules/invert.js generated vendored Normal file
View File

@ -0,0 +1,11 @@
import keys from './keys.js';
// Invert the keys and values of an object. The values must be serializable.
export default function invert(obj) {
var result = {};
var _keys = keys(obj);
for (var i = 0, length = _keys.length; i < length; i++) {
result[obj[_keys[i]]] = _keys[i];
}
return result;
}

28
node_modules/underscore/modules/invoke.js generated vendored Normal file
View File

@ -0,0 +1,28 @@
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 contextPath, func;
if (isFunction(path)) {
func = path;
} else {
path = toPath(path);
contextPath = path.slice(0, -1);
path = path[path.length - 1];
}
return map(obj, function(context) {
var method = func;
if (!method) {
if (contextPath && contextPath.length) {
context = deepGet(context, contextPath);
}
if (context == null) return void 0;
method = context[path];
}
return method == null ? method : method.apply(context, args);
});
});

16
node_modules/underscore/modules/isArguments.js generated vendored Normal file
View File

@ -0,0 +1,16 @@
import tagTester from './_tagTester.js';
import has from './_has.js';
var isArguments = tagTester('Arguments');
// Define a fallback version of the method in browsers (ahem, IE < 9), where
// there isn't any inspectable "Arguments" type.
(function() {
if (!isArguments(arguments)) {
isArguments = function(obj) {
return has(obj, 'callee');
};
}
}());
export default isArguments;

6
node_modules/underscore/modules/isArray.js generated vendored Normal file
View File

@ -0,0 +1,6 @@
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');

3
node_modules/underscore/modules/isArrayBuffer.js generated vendored Normal file
View File

@ -0,0 +1,3 @@
import tagTester from './_tagTester.js';
export default tagTester('ArrayBuffer');

6
node_modules/underscore/modules/isBoolean.js generated vendored Normal file
View File

@ -0,0 +1,6 @@
import { toString } from './_setup.js';
// Is a given value a boolean?
export default function isBoolean(obj) {
return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
}

14
node_modules/underscore/modules/isDataView.js generated vendored Normal file
View File

@ -0,0 +1,14 @@
import tagTester from './_tagTester.js';
import isFunction from './isFunction.js';
import isArrayBuffer from './isArrayBuffer.js';
import { hasStringTagBug } from './_stringTagBug.js';
var isDataView = tagTester('DataView');
// In IE 10 - Edge 13, we need a different heuristic
// to determine whether an object is a `DataView`.
function ie10IsDataView(obj) {
return obj != null && isFunction(obj.getInt8) && isArrayBuffer(obj.buffer);
}
export default (hasStringTagBug ? ie10IsDataView : isDataView);

3
node_modules/underscore/modules/isDate.js generated vendored Normal file
View File

@ -0,0 +1,3 @@
import tagTester from './_tagTester.js';
export default tagTester('Date');

4
node_modules/underscore/modules/isElement.js generated vendored Normal file
View File

@ -0,0 +1,4 @@
// Is a given value a DOM element?
export default function isElement(obj) {
return !!(obj && obj.nodeType === 1);
}

18
node_modules/underscore/modules/isEmpty.js generated vendored Normal file
View File

@ -0,0 +1,18 @@
import getLength from './_getLength.js';
import isArray from './isArray.js';
import isString from './isString.js';
import isArguments from './isArguments.js';
import keys from './keys.js';
// Is a given array, string, or object empty?
// An "empty" object has no enumerable own-properties.
export default function isEmpty(obj) {
if (obj == null) return true;
// Skip the more expensive `toString`-based type checks if `obj` has no
// `.length`.
var length = getLength(obj);
if (typeof length == 'number' && (
isArray(obj) || isString(obj) || isArguments(obj)
)) return length === 0;
return getLength(keys(obj)) === 0;
}

138
node_modules/underscore/modules/isEqual.js generated vendored Normal file
View File

@ -0,0 +1,138 @@
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 { hasStringTagBug } from './_stringTagBug.js';
import isDataView from './isDataView.js';
import keys from './keys.js';
import has from './_has.js';
import toBufferView from './_toBufferView.js';
// We use this string twice, so give it a name for minification.
var tagDataView = '[object DataView]';
// Internal recursive comparison function for `_.isEqual`.
function eq(a, b, aStack, bStack) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
// See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).
if (a === b) return a !== 0 || 1 / a === 1 / b;
// `null` or `undefined` only equal to itself (strict comparison).
if (a == null || b == null) return false;
// `NaN`s are equivalent, but non-reflexive.
if (a !== a) return b !== b;
// Exhaust primitive checks
var type = typeof a;
if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
return deepEq(a, b, aStack, bStack);
}
// Internal recursive comparison function for `_.isEqual`.
function deepEq(a, b, aStack, bStack) {
// Unwrap any wrapped objects.
if (a instanceof _) a = a._wrapped;
if (b instanceof _) b = b._wrapped;
// Compare `[[Class]]` names.
var className = toString.call(a);
if (className !== toString.call(b)) return false;
// Work around a bug in IE 10 - Edge 13.
if (hasStringTagBug && className == '[object Object]' && isDataView(a)) {
if (!isDataView(b)) return false;
className = tagDataView;
}
switch (className) {
// These types are compared by value.
case '[object RegExp]':
// RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
case '[object String]':
// Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
// equivalent to `new String("5")`.
return '' + a === '' + b;
case '[object Number]':
// `NaN`s are equivalent, but non-reflexive.
// Object(NaN) is equivalent to NaN.
if (+a !== +a) return +b !== +b;
// An `egal` comparison is performed for other numeric values.
return +a === 0 ? 1 / +a === 1 / b : +a === +b;
case '[object Date]':
case '[object Boolean]':
// Coerce dates and booleans to numeric primitive values. Dates are compared by their
// millisecond representations. Note that invalid dates with millisecond representations
// of `NaN` are not equivalent.
return +a === +b;
case '[object Symbol]':
return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);
case '[object ArrayBuffer]':
case tagDataView:
// Coerce to typed array so we can fall through.
return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);
}
var areArrays = className === '[object Array]';
if (!areArrays && isTypedArray(a)) {
var byteLength = getByteLength(a);
if (byteLength !== getByteLength(b)) return false;
if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;
areArrays = true;
}
if (!areArrays) {
if (typeof a != 'object' || typeof b != 'object') return false;
// Objects with different constructors are not equivalent, but `Object`s or `Array`s
// from different frames are.
var aCtor = a.constructor, bCtor = b.constructor;
if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor &&
isFunction(bCtor) && bCtor instanceof bCtor)
&& ('constructor' in a && 'constructor' in b)) {
return false;
}
}
// Assume equality for cyclic structures. The algorithm for detecting cyclic
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
// Initializing stack of traversed objects.
// It's done here since we only need them for objects and arrays comparison.
aStack = aStack || [];
bStack = bStack || [];
var length = aStack.length;
while (length--) {
// Linear search. Performance is inversely proportional to the number of
// unique nested structures.
if (aStack[length] === a) return bStack[length] === b;
}
// Add the first object to the stack of traversed objects.
aStack.push(a);
bStack.push(b);
// Recursively compare objects and arrays.
if (areArrays) {
// Compare array lengths to determine if a deep comparison is necessary.
length = a.length;
if (length !== b.length) return false;
// Deep compare the contents, ignoring non-numeric properties.
while (length--) {
if (!eq(a[length], b[length], aStack, bStack)) return false;
}
} else {
// Deep compare objects.
var _keys = keys(a), key;
length = _keys.length;
// Ensure that both objects contain the same number of properties before comparing deep equality.
if (keys(b).length !== length) return false;
while (length--) {
// Deep compare each member
key = _keys[length];
if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
}
}
// Remove the first object from the stack of traversed objects.
aStack.pop();
bStack.pop();
return true;
}
// Perform a deep comparison to check if two objects are equal.
export default function isEqual(a, b) {
return eq(a, b);
}

3
node_modules/underscore/modules/isError.js generated vendored Normal file
View File

@ -0,0 +1,3 @@
import tagTester from './_tagTester.js';
export default tagTester('Error');

7
node_modules/underscore/modules/isFinite.js generated vendored Normal file
View File

@ -0,0 +1,7 @@
import { _isFinite } from './_setup.js';
import isSymbol from './isSymbol.js';
// Is a given object a finite number?
export default function isFinite(obj) {
return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj));
}

15
node_modules/underscore/modules/isFunction.js generated vendored Normal file
View File

@ -0,0 +1,15 @@
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;
if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
isFunction = function(obj) {
return typeof obj == 'function' || false;
};
}
export default isFunction;

5
node_modules/underscore/modules/isMap.js generated vendored Normal file
View File

@ -0,0 +1,5 @@
import tagTester from './_tagTester.js';
import { isIE11 } from './_stringTagBug.js';
import { ie11fingerprint, mapMethods } from './_methodFingerprint.js';
export default isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map');

13
node_modules/underscore/modules/isMatch.js generated vendored Normal file
View File

@ -0,0 +1,13 @@
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[i];
if (attrs[key] !== obj[key] || !(key in obj)) return false;
}
return true;
}

7
node_modules/underscore/modules/isNaN.js generated vendored Normal file
View File

@ -0,0 +1,7 @@
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);
}

4
node_modules/underscore/modules/isNull.js generated vendored Normal file
View File

@ -0,0 +1,4 @@
// Is a given value equal to null?
export default function isNull(obj) {
return obj === null;
}

3
node_modules/underscore/modules/isNumber.js generated vendored Normal file
View File

@ -0,0 +1,3 @@
import tagTester from './_tagTester.js';
export default tagTester('Number');

5
node_modules/underscore/modules/isObject.js generated vendored Normal file
View File

@ -0,0 +1,5 @@
// Is a given variable an object?
export default function isObject(obj) {
var type = typeof obj;
return type === 'function' || (type === 'object' && !!obj);
}

3
node_modules/underscore/modules/isRegExp.js generated vendored Normal file
View File

@ -0,0 +1,3 @@
import tagTester from './_tagTester.js';
export default tagTester('RegExp');

5
node_modules/underscore/modules/isSet.js generated vendored Normal file
View File

@ -0,0 +1,5 @@
import tagTester from './_tagTester.js';
import { isIE11 } from './_stringTagBug.js';
import { ie11fingerprint, setMethods } from './_methodFingerprint.js';
export default isIE11 ? ie11fingerprint(setMethods) : tagTester('Set');

3
node_modules/underscore/modules/isString.js generated vendored Normal file
View File

@ -0,0 +1,3 @@
import tagTester from './_tagTester.js';
export default tagTester('String');

Some files were not shown because too many files have changed in this diff Show More