Project files

This commit is contained in:
2023-11-09 18:47:11 +01:00
parent 695abe054b
commit c415135aae
8554 changed files with 858111 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _symbols = require("./symbols.js");
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound]
var arrayFrom = Array.from || function (obj, mapFn, thisArg) {
if (obj == null) {
throw new TypeError('Array.from requires an array-like object - not null or undefined');
} // Is Iterable?
var iteratorMethod = obj[_symbols.SYMBOL_ITERATOR];
if (typeof iteratorMethod === 'function') {
var iterator = iteratorMethod.call(obj);
var result = [];
var step;
for (var i = 0; !(step = iterator.next()).done; ++i) {
result.push(mapFn.call(thisArg, step.value, i)); // Infinite Iterators could cause forEach to run forever.
// After a very large number of iterations, produce an error.
// istanbul ignore if (Too big to actually test)
if (i > 9999999) {
throw new TypeError('Near-infinite iteration.');
}
}
return result;
} // Is Array like?
var length = obj.length;
if (typeof length === 'number' && length >= 0 && length % 1 === 0) {
var _result = [];
for (var _i = 0; _i < length; ++_i) {
if (Object.prototype.hasOwnProperty.call(obj, _i)) {
_result.push(mapFn.call(thisArg, obj[_i], _i));
}
}
return _result;
}
return [];
};
var _default = arrayFrom;
exports.default = _default;

View File

@@ -0,0 +1,58 @@
// @flow strict
import { SYMBOL_ITERATOR } from './symbols';
declare function arrayFrom<T>(arrayLike: Iterable<T>): Array<T>;
// eslint-disable-next-line no-redeclare
declare function arrayFrom<T: mixed>(
arrayLike: mixed,
mapFn?: (elem: mixed, index: number) => T,
thisArg?: mixed,
): Array<T>;
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound]
const arrayFrom =
Array.from ||
function (obj, mapFn, thisArg) {
if (obj == null) {
throw new TypeError(
'Array.from requires an array-like object - not null or undefined',
);
}
// Is Iterable?
const iteratorMethod = obj[SYMBOL_ITERATOR];
if (typeof iteratorMethod === 'function') {
const iterator = iteratorMethod.call(obj);
const result = [];
let step;
for (let i = 0; !(step = iterator.next()).done; ++i) {
result.push(mapFn.call(thisArg, step.value, i));
// Infinite Iterators could cause forEach to run forever.
// After a very large number of iterations, produce an error.
// istanbul ignore if (Too big to actually test)
if (i > 9999999) {
throw new TypeError('Near-infinite iteration.');
}
}
return result;
}
// Is Array like?
const length = obj.length;
if (typeof length === 'number' && length >= 0 && length % 1 === 0) {
const result = [];
for (let i = 0; i < length; ++i) {
if (Object.prototype.hasOwnProperty.call(obj, i)) {
result.push(mapFn.call(thisArg, obj[i], i));
}
}
return result;
}
return [];
};
export default arrayFrom;

View File

@@ -0,0 +1,49 @@
import { SYMBOL_ITERATOR } from "./symbols.mjs";
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound]
var arrayFrom = Array.from || function (obj, mapFn, thisArg) {
if (obj == null) {
throw new TypeError('Array.from requires an array-like object - not null or undefined');
} // Is Iterable?
var iteratorMethod = obj[SYMBOL_ITERATOR];
if (typeof iteratorMethod === 'function') {
var iterator = iteratorMethod.call(obj);
var result = [];
var step;
for (var i = 0; !(step = iterator.next()).done; ++i) {
result.push(mapFn.call(thisArg, step.value, i)); // Infinite Iterators could cause forEach to run forever.
// After a very large number of iterations, produce an error.
// istanbul ignore if (Too big to actually test)
if (i > 9999999) {
throw new TypeError('Near-infinite iteration.');
}
}
return result;
} // Is Array like?
var length = obj.length;
if (typeof length === 'number' && length >= 0 && length % 1 === 0) {
var _result = [];
for (var _i = 0; _i < length; ++_i) {
if (Object.prototype.hasOwnProperty.call(obj, _i)) {
_result.push(mapFn.call(thisArg, obj[_i], _i));
}
}
return _result;
}
return [];
};
export default arrayFrom;

View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound]
var find = Array.prototype.find ? function (list, predicate) {
return Array.prototype.find.call(list, predicate);
} : function (list, predicate) {
for (var _i2 = 0; _i2 < list.length; _i2++) {
var value = list[_i2];
if (predicate(value)) {
return value;
}
}
};
var _default = find;
exports.default = _default;

View File

@@ -0,0 +1,20 @@
// @flow strict
declare function find<T>(
list: $ReadOnlyArray<T>,
predicate: (item: T) => boolean,
): T | void;
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound]
const find = Array.prototype.find
? function (list, predicate) {
return Array.prototype.find.call(list, predicate);
}
: function (list, predicate) {
for (const value of list) {
if (predicate(value)) {
return value;
}
}
};
export default find;

View File

@@ -0,0 +1,14 @@
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound]
var find = Array.prototype.find ? function (list, predicate) {
return Array.prototype.find.call(list, predicate);
} : function (list, predicate) {
for (var _i2 = 0; _i2 < list.length; _i2++) {
var value = list[_i2];
if (predicate(value)) {
return value;
}
}
};
export default find;

View File

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441
var isFinitePolyfill = Number.isFinite || function (value) {
return typeof value === 'number' && isFinite(value);
};
var _default = isFinitePolyfill;
exports.default = _default;

View File

@@ -0,0 +1,13 @@
// @flow strict
declare function isFinitePolyfill(
value: mixed,
): boolean %checks(typeof value === 'number');
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441
const isFinitePolyfill =
Number.isFinite ||
function (value) {
return typeof value === 'number' && isFinite(value);
};
export default isFinitePolyfill;

View File

@@ -0,0 +1,7 @@
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441
var isFinitePolyfill = Number.isFinite || function (value) {
return typeof value === 'number' && isFinite(value);
};
export default isFinitePolyfill;

View File

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441
var isInteger = Number.isInteger || function (value) {
return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
};
var _default = isInteger;
exports.default = _default;

View File

@@ -0,0 +1,16 @@
// @flow strict
declare function isInteger(value: mixed): boolean %checks(typeof value ===
'number');
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441
const isInteger =
Number.isInteger ||
function (value) {
return (
typeof value === 'number' &&
isFinite(value) &&
Math.floor(value) === value
);
};
export default isInteger;

View File

@@ -0,0 +1,7 @@
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441
var isInteger = Number.isInteger || function (value) {
return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
};
export default isInteger;

View File

@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441
var objectEntries = Object.entries || function (obj) {
return Object.keys(obj).map(function (key) {
return [key, obj[key]];
});
};
var _default = objectEntries;
exports.default = _default;

View File

@@ -0,0 +1,11 @@
// @flow strict
import type { ObjMap } from '../jsutils/ObjMap';
declare function objectEntries<T>(obj: ObjMap<T>): Array<[string, T]>;
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441
const objectEntries =
Object.entries || ((obj) => Object.keys(obj).map((key) => [key, obj[key]]));
export default objectEntries;

View File

@@ -0,0 +1,9 @@
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441
var objectEntries = Object.entries || function (obj) {
return Object.keys(obj).map(function (key) {
return [key, obj[key]];
});
};
export default objectEntries;

View File

@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441
var objectValues = Object.values || function (obj) {
return Object.keys(obj).map(function (key) {
return obj[key];
});
};
var _default = objectValues;
exports.default = _default;

View File

@@ -0,0 +1,10 @@
// @flow strict
import type { ObjMap } from '../jsutils/ObjMap';
declare function objectValues<T>(obj: ObjMap<T>): Array<T>;
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441
const objectValues =
Object.values || ((obj) => Object.keys(obj).map((key) => obj[key]));
export default objectValues;

View File

@@ -0,0 +1,9 @@
/* eslint-disable no-redeclare */
// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441
var objectValues = Object.values || function (obj) {
return Object.keys(obj).map(function (key) {
return obj[key];
});
};
export default objectValues;

View File

@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SYMBOL_TO_STRING_TAG = exports.SYMBOL_ASYNC_ITERATOR = exports.SYMBOL_ITERATOR = void 0;
// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator
// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
var SYMBOL_ITERATOR = typeof Symbol === 'function' && Symbol.iterator != null ? Symbol.iterator : '@@iterator'; // In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator
// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
exports.SYMBOL_ITERATOR = SYMBOL_ITERATOR;
var SYMBOL_ASYNC_ITERATOR = typeof Symbol === 'function' && Symbol.asyncIterator != null ? Symbol.asyncIterator : '@@asyncIterator'; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
exports.SYMBOL_ASYNC_ITERATOR = SYMBOL_ASYNC_ITERATOR;
var SYMBOL_TO_STRING_TAG = typeof Symbol === 'function' && Symbol.toStringTag != null ? Symbol.toStringTag : '@@toStringTag';
exports.SYMBOL_TO_STRING_TAG = SYMBOL_TO_STRING_TAG;

View File

@@ -0,0 +1,20 @@
// @flow strict
// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator
// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
export const SYMBOL_ITERATOR: string =
typeof Symbol === 'function' && Symbol.iterator != null
? Symbol.iterator
: '@@iterator';
// In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator
// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
export const SYMBOL_ASYNC_ITERATOR: string =
typeof Symbol === 'function' && Symbol.asyncIterator != null
? Symbol.asyncIterator
: '@@asyncIterator';
// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
export const SYMBOL_TO_STRING_TAG: string =
typeof Symbol === 'function' && Symbol.toStringTag != null
? Symbol.toStringTag
: '@@toStringTag';

View File

@@ -0,0 +1,8 @@
// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator
// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
export var SYMBOL_ITERATOR = typeof Symbol === 'function' && Symbol.iterator != null ? Symbol.iterator : '@@iterator'; // In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator
// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
export var SYMBOL_ASYNC_ITERATOR = typeof Symbol === 'function' && Symbol.asyncIterator != null ? Symbol.asyncIterator : '@@asyncIterator'; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
export var SYMBOL_TO_STRING_TAG = typeof Symbol === 'function' && Symbol.toStringTag != null ? Symbol.toStringTag : '@@toStringTag';