diff options
Diffstat (limited to 'school/node_modules/graphql/jsutils')
78 files changed, 0 insertions, 2436 deletions
diff --git a/school/node_modules/graphql/jsutils/Maybe.d.ts b/school/node_modules/graphql/jsutils/Maybe.d.ts deleted file mode 100644 index e8b5e21..0000000 --- a/school/node_modules/graphql/jsutils/Maybe.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Conveniently represents flow's "Maybe" type https://flow.org/en/docs/types/maybe/ -export type Maybe<T> = null | undefined | T; diff --git a/school/node_modules/graphql/jsutils/ObjMap.js b/school/node_modules/graphql/jsutils/ObjMap.js deleted file mode 100644 index 3918c74..0000000 --- a/school/node_modules/graphql/jsutils/ObjMap.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; diff --git a/school/node_modules/graphql/jsutils/ObjMap.js.flow b/school/node_modules/graphql/jsutils/ObjMap.js.flow deleted file mode 100644 index a37d728..0000000 --- a/school/node_modules/graphql/jsutils/ObjMap.js.flow +++ /dev/null @@ -1,8 +0,0 @@ -// @flow strict -export type ObjMap<T> = { [key: string]: T, __proto__: null, ... }; -export type ObjMapLike<T> = ObjMap<T> | { [key: string]: T, ... }; - -export type ReadOnlyObjMap<T> = { +[key: string]: T, __proto__: null, ... }; -export type ReadOnlyObjMapLike<T> = - | ReadOnlyObjMap<T> - | { +[key: string]: T, ... }; diff --git a/school/node_modules/graphql/jsutils/ObjMap.mjs b/school/node_modules/graphql/jsutils/ObjMap.mjs deleted file mode 100644 index 8b13789..0000000 --- a/school/node_modules/graphql/jsutils/ObjMap.mjs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/school/node_modules/graphql/jsutils/Path.d.ts b/school/node_modules/graphql/jsutils/Path.d.ts deleted file mode 100644 index 9a2233d..0000000 --- a/school/node_modules/graphql/jsutils/Path.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -export interface Path { - prev: Path | undefined; - key: string | number; - typename: string | undefined; -} - -/** - * Given a Path and a key, return a new Path containing the new key. - */ -export function addPath( - prev: Path | undefined, - key: string | number, - typename: string | undefined, -): Path; - -/** - * Given a Path, return an Array of the path keys. - */ -export function pathToArray(path: Path): Array<string | number>; diff --git a/school/node_modules/graphql/jsutils/Path.js b/school/node_modules/graphql/jsutils/Path.js deleted file mode 100644 index 9eb2517..0000000 --- a/school/node_modules/graphql/jsutils/Path.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.addPath = addPath; -exports.pathToArray = pathToArray; - -/** - * Given a Path and a key, return a new Path containing the new key. - */ -function addPath(prev, key, typename) { - return { - prev: prev, - key: key, - typename: typename - }; -} -/** - * Given a Path, return an Array of the path keys. - */ - - -function pathToArray(path) { - var flattened = []; - var curr = path; - - while (curr) { - flattened.push(curr.key); - curr = curr.prev; - } - - return flattened.reverse(); -} diff --git a/school/node_modules/graphql/jsutils/Path.js.flow b/school/node_modules/graphql/jsutils/Path.js.flow deleted file mode 100644 index 4b0e23c..0000000 --- a/school/node_modules/graphql/jsutils/Path.js.flow +++ /dev/null @@ -1,30 +0,0 @@ -// @flow strict -export type Path = {| - +prev: Path | void, - +key: string | number, - +typename: string | void, -|}; - -/** - * Given a Path and a key, return a new Path containing the new key. - */ -export function addPath( - prev: $ReadOnly<Path> | void, - key: string | number, - typename: string | void, -): Path { - return { prev, key, typename }; -} - -/** - * Given a Path, return an Array of the path keys. - */ -export function pathToArray(path: ?$ReadOnly<Path>): Array<string | number> { - const flattened = []; - let curr = path; - while (curr) { - flattened.push(curr.key); - curr = curr.prev; - } - return flattened.reverse(); -} diff --git a/school/node_modules/graphql/jsutils/Path.mjs b/school/node_modules/graphql/jsutils/Path.mjs deleted file mode 100644 index af448f0..0000000 --- a/school/node_modules/graphql/jsutils/Path.mjs +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Given a Path and a key, return a new Path containing the new key. - */ -export function addPath(prev, key, typename) { - return { - prev: prev, - key: key, - typename: typename - }; -} -/** - * Given a Path, return an Array of the path keys. - */ - -export function pathToArray(path) { - var flattened = []; - var curr = path; - - while (curr) { - flattened.push(curr.key); - curr = curr.prev; - } - - return flattened.reverse(); -} diff --git a/school/node_modules/graphql/jsutils/PromiseOrValue.d.ts b/school/node_modules/graphql/jsutils/PromiseOrValue.d.ts deleted file mode 100644 index 6b2517e..0000000 --- a/school/node_modules/graphql/jsutils/PromiseOrValue.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type PromiseOrValue<T> = Promise<T> | T; diff --git a/school/node_modules/graphql/jsutils/PromiseOrValue.js b/school/node_modules/graphql/jsutils/PromiseOrValue.js deleted file mode 100644 index 3918c74..0000000 --- a/school/node_modules/graphql/jsutils/PromiseOrValue.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; diff --git a/school/node_modules/graphql/jsutils/PromiseOrValue.js.flow b/school/node_modules/graphql/jsutils/PromiseOrValue.js.flow deleted file mode 100644 index dc8df50..0000000 --- a/school/node_modules/graphql/jsutils/PromiseOrValue.js.flow +++ /dev/null @@ -1,2 +0,0 @@ -// @flow strict -export type PromiseOrValue<+T> = Promise<T> | T; diff --git a/school/node_modules/graphql/jsutils/PromiseOrValue.mjs b/school/node_modules/graphql/jsutils/PromiseOrValue.mjs deleted file mode 100644 index 8b13789..0000000 --- a/school/node_modules/graphql/jsutils/PromiseOrValue.mjs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/school/node_modules/graphql/jsutils/defineInspect.js b/school/node_modules/graphql/jsutils/defineInspect.js deleted file mode 100644 index 9bcdcf5..0000000 --- a/school/node_modules/graphql/jsutils/defineInspect.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = defineInspect; - -var _invariant = _interopRequireDefault(require("./invariant.js")); - -var _nodejsCustomInspectSymbol = _interopRequireDefault(require("./nodejsCustomInspectSymbol.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The `defineInspect()` function defines `inspect()` prototype method as alias of `toJSON` - */ -function defineInspect(classObject) { - var fn = classObject.prototype.toJSON; - typeof fn === 'function' || (0, _invariant.default)(0); - classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317') - - if (_nodejsCustomInspectSymbol.default) { - classObject.prototype[_nodejsCustomInspectSymbol.default] = fn; - } -} diff --git a/school/node_modules/graphql/jsutils/defineInspect.js.flow b/school/node_modules/graphql/jsutils/defineInspect.js.flow deleted file mode 100644 index 5359f76..0000000 --- a/school/node_modules/graphql/jsutils/defineInspect.js.flow +++ /dev/null @@ -1,20 +0,0 @@ -// @flow strict -import invariant from './invariant'; -import nodejsCustomInspectSymbol from './nodejsCustomInspectSymbol'; - -/** - * The `defineInspect()` function defines `inspect()` prototype method as alias of `toJSON` - */ -export default function defineInspect( - classObject: Class<any> | ((...args: Array<any>) => mixed), -): void { - const fn = classObject.prototype.toJSON; - invariant(typeof fn === 'function'); - - classObject.prototype.inspect = fn; - - // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317') - if (nodejsCustomInspectSymbol) { - classObject.prototype[nodejsCustomInspectSymbol] = fn; - } -} diff --git a/school/node_modules/graphql/jsutils/defineInspect.mjs b/school/node_modules/graphql/jsutils/defineInspect.mjs deleted file mode 100644 index 33f6fdb..0000000 --- a/school/node_modules/graphql/jsutils/defineInspect.mjs +++ /dev/null @@ -1,15 +0,0 @@ -import invariant from "./invariant.mjs"; -import nodejsCustomInspectSymbol from "./nodejsCustomInspectSymbol.mjs"; -/** - * The `defineInspect()` function defines `inspect()` prototype method as alias of `toJSON` - */ - -export default function defineInspect(classObject) { - var fn = classObject.prototype.toJSON; - typeof fn === 'function' || invariant(0); - classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317') - - if (nodejsCustomInspectSymbol) { - classObject.prototype[nodejsCustomInspectSymbol] = fn; - } -} diff --git a/school/node_modules/graphql/jsutils/devAssert.js b/school/node_modules/graphql/jsutils/devAssert.js deleted file mode 100644 index 25e6d11..0000000 --- a/school/node_modules/graphql/jsutils/devAssert.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = devAssert; - -function devAssert(condition, message) { - var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js') - - if (!booleanCondition) { - throw new Error(message); - } -} diff --git a/school/node_modules/graphql/jsutils/devAssert.js.flow b/school/node_modules/graphql/jsutils/devAssert.js.flow deleted file mode 100644 index 691eae7..0000000 --- a/school/node_modules/graphql/jsutils/devAssert.js.flow +++ /dev/null @@ -1,8 +0,0 @@ -// @flow strict -export default function devAssert(condition: mixed, message: string): void { - const booleanCondition = Boolean(condition); - // istanbul ignore else (See transformation done in './resources/inlineInvariant.js') - if (!booleanCondition) { - throw new Error(message); - } -} diff --git a/school/node_modules/graphql/jsutils/devAssert.mjs b/school/node_modules/graphql/jsutils/devAssert.mjs deleted file mode 100644 index e19b7eb..0000000 --- a/school/node_modules/graphql/jsutils/devAssert.mjs +++ /dev/null @@ -1,7 +0,0 @@ -export default function devAssert(condition, message) { - var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js') - - if (!booleanCondition) { - throw new Error(message); - } -} diff --git a/school/node_modules/graphql/jsutils/didYouMean.js b/school/node_modules/graphql/jsutils/didYouMean.js deleted file mode 100644 index d6b0d90..0000000 --- a/school/node_modules/graphql/jsutils/didYouMean.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = didYouMean; -var MAX_SUGGESTIONS = 5; -/** - * Given [ A, B, C ] return ' Did you mean A, B, or C?'. - */ - -// eslint-disable-next-line no-redeclare -function didYouMean(firstArg, secondArg) { - var _ref = typeof firstArg === 'string' ? [firstArg, secondArg] : [undefined, firstArg], - subMessage = _ref[0], - suggestionsArg = _ref[1]; - - var message = ' Did you mean '; - - if (subMessage) { - message += subMessage + ' '; - } - - var suggestions = suggestionsArg.map(function (x) { - return "\"".concat(x, "\""); - }); - - switch (suggestions.length) { - case 0: - return ''; - - case 1: - return message + suggestions[0] + '?'; - - case 2: - return message + suggestions[0] + ' or ' + suggestions[1] + '?'; - } - - var selected = suggestions.slice(0, MAX_SUGGESTIONS); - var lastItem = selected.pop(); - return message + selected.join(', ') + ', or ' + lastItem + '?'; -} diff --git a/school/node_modules/graphql/jsutils/didYouMean.js.flow b/school/node_modules/graphql/jsutils/didYouMean.js.flow deleted file mode 100644 index fc4e9e1..0000000 --- a/school/node_modules/graphql/jsutils/didYouMean.js.flow +++ /dev/null @@ -1,39 +0,0 @@ -// @flow strict -const MAX_SUGGESTIONS = 5; - -/** - * Given [ A, B, C ] return ' Did you mean A, B, or C?'. - */ -declare function didYouMean(suggestions: $ReadOnlyArray<string>): string; -// eslint-disable-next-line no-redeclare -declare function didYouMean( - subMessage: string, - suggestions: $ReadOnlyArray<string>, -): string; - -// eslint-disable-next-line no-redeclare -export default function didYouMean(firstArg, secondArg) { - const [subMessage, suggestionsArg] = - typeof firstArg === 'string' - ? [firstArg, secondArg] - : [undefined, firstArg]; - - let message = ' Did you mean '; - if (subMessage) { - message += subMessage + ' '; - } - - const suggestions = suggestionsArg.map((x) => `"${x}"`); - switch (suggestions.length) { - case 0: - return ''; - case 1: - return message + suggestions[0] + '?'; - case 2: - return message + suggestions[0] + ' or ' + suggestions[1] + '?'; - } - - const selected = suggestions.slice(0, MAX_SUGGESTIONS); - const lastItem = selected.pop(); - return message + selected.join(', ') + ', or ' + lastItem + '?'; -} diff --git a/school/node_modules/graphql/jsutils/didYouMean.mjs b/school/node_modules/graphql/jsutils/didYouMean.mjs deleted file mode 100644 index 19e26cc..0000000 --- a/school/node_modules/graphql/jsutils/didYouMean.mjs +++ /dev/null @@ -1,36 +0,0 @@ -var MAX_SUGGESTIONS = 5; -/** - * Given [ A, B, C ] return ' Did you mean A, B, or C?'. - */ - -// eslint-disable-next-line no-redeclare -export default function didYouMean(firstArg, secondArg) { - var _ref = typeof firstArg === 'string' ? [firstArg, secondArg] : [undefined, firstArg], - subMessage = _ref[0], - suggestionsArg = _ref[1]; - - var message = ' Did you mean '; - - if (subMessage) { - message += subMessage + ' '; - } - - var suggestions = suggestionsArg.map(function (x) { - return "\"".concat(x, "\""); - }); - - switch (suggestions.length) { - case 0: - return ''; - - case 1: - return message + suggestions[0] + '?'; - - case 2: - return message + suggestions[0] + ' or ' + suggestions[1] + '?'; - } - - var selected = suggestions.slice(0, MAX_SUGGESTIONS); - var lastItem = selected.pop(); - return message + selected.join(', ') + ', or ' + lastItem + '?'; -} diff --git a/school/node_modules/graphql/jsutils/identityFunc.js b/school/node_modules/graphql/jsutils/identityFunc.js deleted file mode 100644 index 630772f..0000000 --- a/school/node_modules/graphql/jsutils/identityFunc.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = identityFunc; - -/** - * Returns the first argument it receives. - */ -function identityFunc(x) { - return x; -} diff --git a/school/node_modules/graphql/jsutils/identityFunc.js.flow b/school/node_modules/graphql/jsutils/identityFunc.js.flow deleted file mode 100644 index a37961e..0000000 --- a/school/node_modules/graphql/jsutils/identityFunc.js.flow +++ /dev/null @@ -1,7 +0,0 @@ -// @flow strict -/** - * Returns the first argument it receives. - */ -export default function identityFunc<T>(x: T): T { - return x; -} diff --git a/school/node_modules/graphql/jsutils/identityFunc.mjs b/school/node_modules/graphql/jsutils/identityFunc.mjs deleted file mode 100644 index daf2391..0000000 --- a/school/node_modules/graphql/jsutils/identityFunc.mjs +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Returns the first argument it receives. - */ -export default function identityFunc(x) { - return x; -} diff --git a/school/node_modules/graphql/jsutils/inspect.js b/school/node_modules/graphql/jsutils/inspect.js deleted file mode 100644 index 8d3a16c..0000000 --- a/school/node_modules/graphql/jsutils/inspect.js +++ /dev/null @@ -1,133 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = inspect; - -var _nodejsCustomInspectSymbol = _interopRequireDefault(require("./nodejsCustomInspectSymbol.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -var MAX_ARRAY_LENGTH = 10; -var MAX_RECURSIVE_DEPTH = 2; -/** - * Used to print values in error messages. - */ - -function inspect(value) { - return formatValue(value, []); -} - -function formatValue(value, seenValues) { - switch (_typeof(value)) { - case 'string': - return JSON.stringify(value); - - case 'function': - return value.name ? "[function ".concat(value.name, "]") : '[function]'; - - case 'object': - if (value === null) { - return 'null'; - } - - return formatObjectValue(value, seenValues); - - default: - return String(value); - } -} - -function formatObjectValue(value, previouslySeenValues) { - if (previouslySeenValues.indexOf(value) !== -1) { - return '[Circular]'; - } - - var seenValues = [].concat(previouslySeenValues, [value]); - var customInspectFn = getCustomFn(value); - - if (customInspectFn !== undefined) { - var customValue = customInspectFn.call(value); // check for infinite recursion - - if (customValue !== value) { - return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues); - } - } else if (Array.isArray(value)) { - return formatArray(value, seenValues); - } - - return formatObject(value, seenValues); -} - -function formatObject(object, seenValues) { - var keys = Object.keys(object); - - if (keys.length === 0) { - return '{}'; - } - - if (seenValues.length > MAX_RECURSIVE_DEPTH) { - return '[' + getObjectTag(object) + ']'; - } - - var properties = keys.map(function (key) { - var value = formatValue(object[key], seenValues); - return key + ': ' + value; - }); - return '{ ' + properties.join(', ') + ' }'; -} - -function formatArray(array, seenValues) { - if (array.length === 0) { - return '[]'; - } - - if (seenValues.length > MAX_RECURSIVE_DEPTH) { - return '[Array]'; - } - - var len = Math.min(MAX_ARRAY_LENGTH, array.length); - var remaining = array.length - len; - var items = []; - - for (var i = 0; i < len; ++i) { - items.push(formatValue(array[i], seenValues)); - } - - if (remaining === 1) { - items.push('... 1 more item'); - } else if (remaining > 1) { - items.push("... ".concat(remaining, " more items")); - } - - return '[' + items.join(', ') + ']'; -} - -function getCustomFn(object) { - var customInspectFn = object[String(_nodejsCustomInspectSymbol.default)]; - - if (typeof customInspectFn === 'function') { - return customInspectFn; - } - - if (typeof object.inspect === 'function') { - return object.inspect; - } -} - -function getObjectTag(object) { - var tag = Object.prototype.toString.call(object).replace(/^\[object /, '').replace(/]$/, ''); - - if (tag === 'Object' && typeof object.constructor === 'function') { - var name = object.constructor.name; - - if (typeof name === 'string' && name !== '') { - return name; - } - } - - return tag; -} diff --git a/school/node_modules/graphql/jsutils/inspect.js.flow b/school/node_modules/graphql/jsutils/inspect.js.flow deleted file mode 100644 index 77a2b2c..0000000 --- a/school/node_modules/graphql/jsutils/inspect.js.flow +++ /dev/null @@ -1,128 +0,0 @@ -// @flow strict -/* eslint-disable flowtype/no-weak-types */ -import nodejsCustomInspectSymbol from './nodejsCustomInspectSymbol'; - -const MAX_ARRAY_LENGTH = 10; -const MAX_RECURSIVE_DEPTH = 2; - -/** - * Used to print values in error messages. - */ -export default function inspect(value: mixed): string { - return formatValue(value, []); -} - -function formatValue(value: mixed, seenValues: Array<mixed>): string { - switch (typeof value) { - case 'string': - return JSON.stringify(value); - case 'function': - return value.name ? `[function ${value.name}]` : '[function]'; - case 'object': - if (value === null) { - return 'null'; - } - return formatObjectValue(value, seenValues); - default: - return String(value); - } -} - -function formatObjectValue( - value: Object, - previouslySeenValues: Array<mixed>, -): string { - if (previouslySeenValues.indexOf(value) !== -1) { - return '[Circular]'; - } - - const seenValues = [...previouslySeenValues, value]; - const customInspectFn = getCustomFn(value); - - if (customInspectFn !== undefined) { - const customValue = customInspectFn.call(value); - - // check for infinite recursion - if (customValue !== value) { - return typeof customValue === 'string' - ? customValue - : formatValue(customValue, seenValues); - } - } else if (Array.isArray(value)) { - return formatArray(value, seenValues); - } - - return formatObject(value, seenValues); -} - -function formatObject(object: Object, seenValues: Array<mixed>): string { - const keys = Object.keys(object); - if (keys.length === 0) { - return '{}'; - } - - if (seenValues.length > MAX_RECURSIVE_DEPTH) { - return '[' + getObjectTag(object) + ']'; - } - - const properties = keys.map((key) => { - const value = formatValue(object[key], seenValues); - return key + ': ' + value; - }); - - return '{ ' + properties.join(', ') + ' }'; -} - -function formatArray(array: Array<mixed>, seenValues: Array<mixed>): string { - if (array.length === 0) { - return '[]'; - } - - if (seenValues.length > MAX_RECURSIVE_DEPTH) { - return '[Array]'; - } - - const len = Math.min(MAX_ARRAY_LENGTH, array.length); - const remaining = array.length - len; - const items = []; - - for (let i = 0; i < len; ++i) { - items.push(formatValue(array[i], seenValues)); - } - - if (remaining === 1) { - items.push('... 1 more item'); - } else if (remaining > 1) { - items.push(`... ${remaining} more items`); - } - - return '[' + items.join(', ') + ']'; -} - -function getCustomFn(object: Object) { - const customInspectFn = object[String(nodejsCustomInspectSymbol)]; - - if (typeof customInspectFn === 'function') { - return customInspectFn; - } - - if (typeof object.inspect === 'function') { - return object.inspect; - } -} - -function getObjectTag(object: Object): string { - const tag = Object.prototype.toString - .call(object) - .replace(/^\[object /, '') - .replace(/]$/, ''); - - if (tag === 'Object' && typeof object.constructor === 'function') { - const name = object.constructor.name; - if (typeof name === 'string' && name !== '') { - return name; - } - } - - return tag; -} diff --git a/school/node_modules/graphql/jsutils/inspect.mjs b/school/node_modules/graphql/jsutils/inspect.mjs deleted file mode 100644 index caaf7dc..0000000 --- a/school/node_modules/graphql/jsutils/inspect.mjs +++ /dev/null @@ -1,124 +0,0 @@ -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -/* eslint-disable flowtype/no-weak-types */ -import nodejsCustomInspectSymbol from "./nodejsCustomInspectSymbol.mjs"; -var MAX_ARRAY_LENGTH = 10; -var MAX_RECURSIVE_DEPTH = 2; -/** - * Used to print values in error messages. - */ - -export default function inspect(value) { - return formatValue(value, []); -} - -function formatValue(value, seenValues) { - switch (_typeof(value)) { - case 'string': - return JSON.stringify(value); - - case 'function': - return value.name ? "[function ".concat(value.name, "]") : '[function]'; - - case 'object': - if (value === null) { - return 'null'; - } - - return formatObjectValue(value, seenValues); - - default: - return String(value); - } -} - -function formatObjectValue(value, previouslySeenValues) { - if (previouslySeenValues.indexOf(value) !== -1) { - return '[Circular]'; - } - - var seenValues = [].concat(previouslySeenValues, [value]); - var customInspectFn = getCustomFn(value); - - if (customInspectFn !== undefined) { - var customValue = customInspectFn.call(value); // check for infinite recursion - - if (customValue !== value) { - return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues); - } - } else if (Array.isArray(value)) { - return formatArray(value, seenValues); - } - - return formatObject(value, seenValues); -} - -function formatObject(object, seenValues) { - var keys = Object.keys(object); - - if (keys.length === 0) { - return '{}'; - } - - if (seenValues.length > MAX_RECURSIVE_DEPTH) { - return '[' + getObjectTag(object) + ']'; - } - - var properties = keys.map(function (key) { - var value = formatValue(object[key], seenValues); - return key + ': ' + value; - }); - return '{ ' + properties.join(', ') + ' }'; -} - -function formatArray(array, seenValues) { - if (array.length === 0) { - return '[]'; - } - - if (seenValues.length > MAX_RECURSIVE_DEPTH) { - return '[Array]'; - } - - var len = Math.min(MAX_ARRAY_LENGTH, array.length); - var remaining = array.length - len; - var items = []; - - for (var i = 0; i < len; ++i) { - items.push(formatValue(array[i], seenValues)); - } - - if (remaining === 1) { - items.push('... 1 more item'); - } else if (remaining > 1) { - items.push("... ".concat(remaining, " more items")); - } - - return '[' + items.join(', ') + ']'; -} - -function getCustomFn(object) { - var customInspectFn = object[String(nodejsCustomInspectSymbol)]; - - if (typeof customInspectFn === 'function') { - return customInspectFn; - } - - if (typeof object.inspect === 'function') { - return object.inspect; - } -} - -function getObjectTag(object) { - var tag = Object.prototype.toString.call(object).replace(/^\[object /, '').replace(/]$/, ''); - - if (tag === 'Object' && typeof object.constructor === 'function') { - var name = object.constructor.name; - - if (typeof name === 'string' && name !== '') { - return name; - } - } - - return tag; -} diff --git a/school/node_modules/graphql/jsutils/instanceOf.js b/school/node_modules/graphql/jsutils/instanceOf.js deleted file mode 100644 index 7098094..0000000 --- a/school/node_modules/graphql/jsutils/instanceOf.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _inspect = _interopRequireDefault(require("./inspect.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production -// See: https://webpack.js.org/guides/production/ -var _default = process.env.NODE_ENV === 'production' ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') -// eslint-disable-next-line no-shadow -function instanceOf(value, constructor) { - return value instanceof constructor; -} : // eslint-disable-next-line no-shadow -function instanceOf(value, constructor) { - if (value instanceof constructor) { - return true; - } - - if (_typeof(value) === 'object' && value !== null) { - var _value$constructor; - - var className = constructor.prototype[Symbol.toStringTag]; - var valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library. - Symbol.toStringTag in value ? value[Symbol.toStringTag] : (_value$constructor = value.constructor) === null || _value$constructor === void 0 ? void 0 : _value$constructor.name; - - if (className === valueClassName) { - var stringifiedValue = (0, _inspect.default)(value); - throw new Error("Cannot use ".concat(className, " \"").concat(stringifiedValue, "\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.")); - } - } - - return false; -}; - -exports.default = _default; diff --git a/school/node_modules/graphql/jsutils/instanceOf.js.flow b/school/node_modules/graphql/jsutils/instanceOf.js.flow deleted file mode 100644 index 58faa02..0000000 --- a/school/node_modules/graphql/jsutils/instanceOf.js.flow +++ /dev/null @@ -1,52 +0,0 @@ -// @flow strict -import inspect from './inspect'; - -/** - * A replacement for instanceof which includes an error warning when multi-realm - * constructors are detected. - */ -declare function instanceOf( - value: mixed, - constructor: mixed, -): boolean %checks(value instanceof constructor); - -// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production -// See: https://webpack.js.org/guides/production/ -export default process.env.NODE_ENV === 'production' - ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') - // eslint-disable-next-line no-shadow - function instanceOf(value: mixed, constructor: mixed): boolean { - return value instanceof constructor; - } - : // eslint-disable-next-line no-shadow - function instanceOf(value: any, constructor: any): boolean { - if (value instanceof constructor) { - return true; - } - if (typeof value === 'object' && value !== null) { - const className = constructor.prototype[Symbol.toStringTag]; - const valueClassName = - // We still need to support constructor's name to detect conflicts with older versions of this library. - Symbol.toStringTag in value - ? value[Symbol.toStringTag] - : value.constructor?.name; - if (className === valueClassName) { - const stringifiedValue = inspect(value); - throw new Error( - `Cannot use ${className} "${stringifiedValue}" from another module or realm. - -Ensure that there is only one instance of "graphql" in the node_modules -directory. If different versions of "graphql" are the dependencies of other -relied on modules, use "resolutions" to ensure only one version is installed. - -https://yarnpkg.com/en/docs/selective-version-resolutions - -Duplicate "graphql" modules cannot be used at the same time since different -versions may have different capabilities and behavior. The data from one -version used in the function from another could produce confusing and -spurious results.`, - ); - } - } - return false; - }; diff --git a/school/node_modules/graphql/jsutils/instanceOf.mjs b/school/node_modules/graphql/jsutils/instanceOf.mjs deleted file mode 100644 index ff46fca..0000000 --- a/school/node_modules/graphql/jsutils/instanceOf.mjs +++ /dev/null @@ -1,35 +0,0 @@ -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -import inspect from "./inspect.mjs"; -/** - * A replacement for instanceof which includes an error warning when multi-realm - * constructors are detected. - */ - -// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production -// See: https://webpack.js.org/guides/production/ -export default process.env.NODE_ENV === 'production' ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') -// eslint-disable-next-line no-shadow -function instanceOf(value, constructor) { - return value instanceof constructor; -} : // eslint-disable-next-line no-shadow -function instanceOf(value, constructor) { - if (value instanceof constructor) { - return true; - } - - if (_typeof(value) === 'object' && value !== null) { - var _value$constructor; - - var className = constructor.prototype[Symbol.toStringTag]; - var valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library. - Symbol.toStringTag in value ? value[Symbol.toStringTag] : (_value$constructor = value.constructor) === null || _value$constructor === void 0 ? void 0 : _value$constructor.name; - - if (className === valueClassName) { - var stringifiedValue = inspect(value); - throw new Error("Cannot use ".concat(className, " \"").concat(stringifiedValue, "\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.")); - } - } - - return false; -}; diff --git a/school/node_modules/graphql/jsutils/invariant.js b/school/node_modules/graphql/jsutils/invariant.js deleted file mode 100644 index 2e9e16b..0000000 --- a/school/node_modules/graphql/jsutils/invariant.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = invariant; - -function invariant(condition, message) { - var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js') - - if (!booleanCondition) { - throw new Error(message != null ? message : 'Unexpected invariant triggered.'); - } -} diff --git a/school/node_modules/graphql/jsutils/invariant.js.flow b/school/node_modules/graphql/jsutils/invariant.js.flow deleted file mode 100644 index 6268571..0000000 --- a/school/node_modules/graphql/jsutils/invariant.js.flow +++ /dev/null @@ -1,10 +0,0 @@ -// @flow strict -export default function invariant(condition: mixed, message?: string): void { - const booleanCondition = Boolean(condition); - // istanbul ignore else (See transformation done in './resources/inlineInvariant.js') - if (!booleanCondition) { - throw new Error( - message != null ? message : 'Unexpected invariant triggered.', - ); - } -} diff --git a/school/node_modules/graphql/jsutils/invariant.mjs b/school/node_modules/graphql/jsutils/invariant.mjs deleted file mode 100644 index f1aa4a6..0000000 --- a/school/node_modules/graphql/jsutils/invariant.mjs +++ /dev/null @@ -1,7 +0,0 @@ -export default function invariant(condition, message) { - var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js') - - if (!booleanCondition) { - throw new Error(message != null ? message : 'Unexpected invariant triggered.'); - } -} diff --git a/school/node_modules/graphql/jsutils/isAsyncIterable.js b/school/node_modules/graphql/jsutils/isAsyncIterable.js deleted file mode 100644 index 3f59f2b..0000000 --- a/school/node_modules/graphql/jsutils/isAsyncIterable.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isAsyncIterable; - -var _symbols = require("../polyfills/symbols.js"); - -// eslint-disable-next-line no-redeclare -function isAsyncIterable(maybeAsyncIterable) { - return typeof (maybeAsyncIterable === null || maybeAsyncIterable === void 0 ? void 0 : maybeAsyncIterable[_symbols.SYMBOL_ASYNC_ITERATOR]) === 'function'; -} diff --git a/school/node_modules/graphql/jsutils/isAsyncIterable.js.flow b/school/node_modules/graphql/jsutils/isAsyncIterable.js.flow deleted file mode 100644 index e81f94e..0000000 --- a/school/node_modules/graphql/jsutils/isAsyncIterable.js.flow +++ /dev/null @@ -1,14 +0,0 @@ -// @flow strict -import { SYMBOL_ASYNC_ITERATOR } from '../polyfills/symbols'; - -/** - * Returns true if the provided object implements the AsyncIterator protocol via - * either implementing a `Symbol.asyncIterator` or `"@@asyncIterator"` method. - */ -declare function isAsyncIterable(value: mixed): boolean %checks(value instanceof - AsyncIterable); - -// eslint-disable-next-line no-redeclare -export default function isAsyncIterable(maybeAsyncIterable) { - return typeof maybeAsyncIterable?.[SYMBOL_ASYNC_ITERATOR] === 'function'; -} diff --git a/school/node_modules/graphql/jsutils/isAsyncIterable.mjs b/school/node_modules/graphql/jsutils/isAsyncIterable.mjs deleted file mode 100644 index 444e87c..0000000 --- a/school/node_modules/graphql/jsutils/isAsyncIterable.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import { SYMBOL_ASYNC_ITERATOR } from "../polyfills/symbols.mjs"; -/** - * Returns true if the provided object implements the AsyncIterator protocol via - * either implementing a `Symbol.asyncIterator` or `"@@asyncIterator"` method. - */ - -// eslint-disable-next-line no-redeclare -export default function isAsyncIterable(maybeAsyncIterable) { - return typeof (maybeAsyncIterable === null || maybeAsyncIterable === void 0 ? void 0 : maybeAsyncIterable[SYMBOL_ASYNC_ITERATOR]) === 'function'; -} diff --git a/school/node_modules/graphql/jsutils/isObjectLike.js b/school/node_modules/graphql/jsutils/isObjectLike.js deleted file mode 100644 index 19c9a89..0000000 --- a/school/node_modules/graphql/jsutils/isObjectLike.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isObjectLike; - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -/** - * Return true if `value` is object-like. A value is object-like if it's not - * `null` and has a `typeof` result of "object". - */ -function isObjectLike(value) { - return _typeof(value) == 'object' && value !== null; -} diff --git a/school/node_modules/graphql/jsutils/isObjectLike.js.flow b/school/node_modules/graphql/jsutils/isObjectLike.js.flow deleted file mode 100644 index 86886ab..0000000 --- a/school/node_modules/graphql/jsutils/isObjectLike.js.flow +++ /dev/null @@ -1,8 +0,0 @@ -// @flow strict -/** - * Return true if `value` is object-like. A value is object-like if it's not - * `null` and has a `typeof` result of "object". - */ -export default function isObjectLike(value: mixed): boolean %checks { - return typeof value == 'object' && value !== null; -} diff --git a/school/node_modules/graphql/jsutils/isObjectLike.mjs b/school/node_modules/graphql/jsutils/isObjectLike.mjs deleted file mode 100644 index 41dc3cd..0000000 --- a/school/node_modules/graphql/jsutils/isObjectLike.mjs +++ /dev/null @@ -1,9 +0,0 @@ -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -/** - * Return true if `value` is object-like. A value is object-like if it's not - * `null` and has a `typeof` result of "object". - */ -export default function isObjectLike(value) { - return _typeof(value) == 'object' && value !== null; -} diff --git a/school/node_modules/graphql/jsutils/isPromise.js b/school/node_modules/graphql/jsutils/isPromise.js deleted file mode 100644 index bca6ccc..0000000 --- a/school/node_modules/graphql/jsutils/isPromise.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isPromise; - -/** - * Returns true if the value acts like a Promise, i.e. has a "then" function, - * otherwise returns false. - */ -// eslint-disable-next-line no-redeclare -function isPromise(value) { - return typeof (value === null || value === void 0 ? void 0 : value.then) === 'function'; -} diff --git a/school/node_modules/graphql/jsutils/isPromise.js.flow b/school/node_modules/graphql/jsutils/isPromise.js.flow deleted file mode 100644 index f5c9f75..0000000 --- a/school/node_modules/graphql/jsutils/isPromise.js.flow +++ /dev/null @@ -1,12 +0,0 @@ -// @flow strict -/** - * Returns true if the value acts like a Promise, i.e. has a "then" function, - * otherwise returns false. - */ -declare function isPromise(value: mixed): boolean %checks(value instanceof - Promise); - -// eslint-disable-next-line no-redeclare -export default function isPromise(value) { - return typeof value?.then === 'function'; -} diff --git a/school/node_modules/graphql/jsutils/isPromise.mjs b/school/node_modules/graphql/jsutils/isPromise.mjs deleted file mode 100644 index 2d9079b..0000000 --- a/school/node_modules/graphql/jsutils/isPromise.mjs +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Returns true if the value acts like a Promise, i.e. has a "then" function, - * otherwise returns false. - */ -// eslint-disable-next-line no-redeclare -export default function isPromise(value) { - return typeof (value === null || value === void 0 ? void 0 : value.then) === 'function'; -} diff --git a/school/node_modules/graphql/jsutils/keyMap.js b/school/node_modules/graphql/jsutils/keyMap.js deleted file mode 100644 index c067210..0000000 --- a/school/node_modules/graphql/jsutils/keyMap.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = keyMap; - -/** - * Creates a keyed JS object from an array, given a function to produce the keys - * for each value in the array. - * - * This provides a convenient lookup for the array items if the key function - * produces unique results. - * - * const phoneBook = [ - * { name: 'Jon', num: '555-1234' }, - * { name: 'Jenny', num: '867-5309' } - * ] - * - * // { Jon: { name: 'Jon', num: '555-1234' }, - * // Jenny: { name: 'Jenny', num: '867-5309' } } - * const entriesByName = keyMap( - * phoneBook, - * entry => entry.name - * ) - * - * // { name: 'Jenny', num: '857-6309' } - * const jennyEntry = entriesByName['Jenny'] - * - */ -function keyMap(list, keyFn) { - return list.reduce(function (map, item) { - map[keyFn(item)] = item; - return map; - }, Object.create(null)); -} diff --git a/school/node_modules/graphql/jsutils/keyMap.js.flow b/school/node_modules/graphql/jsutils/keyMap.js.flow deleted file mode 100644 index b165360..0000000 --- a/school/node_modules/graphql/jsutils/keyMap.js.flow +++ /dev/null @@ -1,35 +0,0 @@ -// @flow strict -import type { ObjMap } from './ObjMap'; - -/** - * Creates a keyed JS object from an array, given a function to produce the keys - * for each value in the array. - * - * This provides a convenient lookup for the array items if the key function - * produces unique results. - * - * const phoneBook = [ - * { name: 'Jon', num: '555-1234' }, - * { name: 'Jenny', num: '867-5309' } - * ] - * - * // { Jon: { name: 'Jon', num: '555-1234' }, - * // Jenny: { name: 'Jenny', num: '867-5309' } } - * const entriesByName = keyMap( - * phoneBook, - * entry => entry.name - * ) - * - * // { name: 'Jenny', num: '857-6309' } - * const jennyEntry = entriesByName['Jenny'] - * - */ -export default function keyMap<T>( - list: $ReadOnlyArray<T>, - keyFn: (item: T) => string, -): ObjMap<T> { - return list.reduce((map, item) => { - map[keyFn(item)] = item; - return map; - }, Object.create(null)); -} diff --git a/school/node_modules/graphql/jsutils/keyMap.mjs b/school/node_modules/graphql/jsutils/keyMap.mjs deleted file mode 100644 index 567dd86..0000000 --- a/school/node_modules/graphql/jsutils/keyMap.mjs +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Creates a keyed JS object from an array, given a function to produce the keys - * for each value in the array. - * - * This provides a convenient lookup for the array items if the key function - * produces unique results. - * - * const phoneBook = [ - * { name: 'Jon', num: '555-1234' }, - * { name: 'Jenny', num: '867-5309' } - * ] - * - * // { Jon: { name: 'Jon', num: '555-1234' }, - * // Jenny: { name: 'Jenny', num: '867-5309' } } - * const entriesByName = keyMap( - * phoneBook, - * entry => entry.name - * ) - * - * // { name: 'Jenny', num: '857-6309' } - * const jennyEntry = entriesByName['Jenny'] - * - */ -export default function keyMap(list, keyFn) { - return list.reduce(function (map, item) { - map[keyFn(item)] = item; - return map; - }, Object.create(null)); -} diff --git a/school/node_modules/graphql/jsutils/keyValMap.js b/school/node_modules/graphql/jsutils/keyValMap.js deleted file mode 100644 index 0b2dab5..0000000 --- a/school/node_modules/graphql/jsutils/keyValMap.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = keyValMap; - -/** - * Creates a keyed JS object from an array, given a function to produce the keys - * and a function to produce the values from each item in the array. - * - * const phoneBook = [ - * { name: 'Jon', num: '555-1234' }, - * { name: 'Jenny', num: '867-5309' } - * ] - * - * // { Jon: '555-1234', Jenny: '867-5309' } - * const phonesByName = keyValMap( - * phoneBook, - * entry => entry.name, - * entry => entry.num - * ) - * - */ -function keyValMap(list, keyFn, valFn) { - return list.reduce(function (map, item) { - map[keyFn(item)] = valFn(item); - return map; - }, Object.create(null)); -} diff --git a/school/node_modules/graphql/jsutils/keyValMap.js.flow b/school/node_modules/graphql/jsutils/keyValMap.js.flow deleted file mode 100644 index d3aa602..0000000 --- a/school/node_modules/graphql/jsutils/keyValMap.js.flow +++ /dev/null @@ -1,30 +0,0 @@ -// @flow strict -import type { ObjMap } from './ObjMap'; - -/** - * Creates a keyed JS object from an array, given a function to produce the keys - * and a function to produce the values from each item in the array. - * - * const phoneBook = [ - * { name: 'Jon', num: '555-1234' }, - * { name: 'Jenny', num: '867-5309' } - * ] - * - * // { Jon: '555-1234', Jenny: '867-5309' } - * const phonesByName = keyValMap( - * phoneBook, - * entry => entry.name, - * entry => entry.num - * ) - * - */ -export default function keyValMap<T, V>( - list: $ReadOnlyArray<T>, - keyFn: (item: T) => string, - valFn: (item: T) => V, -): ObjMap<V> { - return list.reduce((map, item) => { - map[keyFn(item)] = valFn(item); - return map; - }, Object.create(null)); -} diff --git a/school/node_modules/graphql/jsutils/keyValMap.mjs b/school/node_modules/graphql/jsutils/keyValMap.mjs deleted file mode 100644 index 5061c66..0000000 --- a/school/node_modules/graphql/jsutils/keyValMap.mjs +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Creates a keyed JS object from an array, given a function to produce the keys - * and a function to produce the values from each item in the array. - * - * const phoneBook = [ - * { name: 'Jon', num: '555-1234' }, - * { name: 'Jenny', num: '867-5309' } - * ] - * - * // { Jon: '555-1234', Jenny: '867-5309' } - * const phonesByName = keyValMap( - * phoneBook, - * entry => entry.name, - * entry => entry.num - * ) - * - */ -export default function keyValMap(list, keyFn, valFn) { - return list.reduce(function (map, item) { - map[keyFn(item)] = valFn(item); - return map; - }, Object.create(null)); -} diff --git a/school/node_modules/graphql/jsutils/mapValue.js b/school/node_modules/graphql/jsutils/mapValue.js deleted file mode 100644 index 77d9038..0000000 --- a/school/node_modules/graphql/jsutils/mapValue.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = mapValue; - -var _objectEntries3 = _interopRequireDefault(require("../polyfills/objectEntries.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Creates an object map with the same keys as `map` and values generated by - * running each value of `map` thru `fn`. - */ -function mapValue(map, fn) { - var result = Object.create(null); - - for (var _i2 = 0, _objectEntries2 = (0, _objectEntries3.default)(map); _i2 < _objectEntries2.length; _i2++) { - var _ref2 = _objectEntries2[_i2]; - var _key = _ref2[0]; - var _value = _ref2[1]; - result[_key] = fn(_value, _key); - } - - return result; -} diff --git a/school/node_modules/graphql/jsutils/mapValue.js.flow b/school/node_modules/graphql/jsutils/mapValue.js.flow deleted file mode 100644 index d6b5da4..0000000 --- a/school/node_modules/graphql/jsutils/mapValue.js.flow +++ /dev/null @@ -1,20 +0,0 @@ -// @flow strict -import objectEntries from '../polyfills/objectEntries'; - -import type { ObjMap } from './ObjMap'; - -/** - * Creates an object map with the same keys as `map` and values generated by - * running each value of `map` thru `fn`. - */ -export default function mapValue<T, V>( - map: ObjMap<T>, - fn: (value: T, key: string) => V, -): ObjMap<V> { - const result = Object.create(null); - - for (const [key, value] of objectEntries(map)) { - result[key] = fn(value, key); - } - return result; -} diff --git a/school/node_modules/graphql/jsutils/mapValue.mjs b/school/node_modules/graphql/jsutils/mapValue.mjs deleted file mode 100644 index 7992abb..0000000 --- a/school/node_modules/graphql/jsutils/mapValue.mjs +++ /dev/null @@ -1,18 +0,0 @@ -import objectEntries from "../polyfills/objectEntries.mjs"; - -/** - * Creates an object map with the same keys as `map` and values generated by - * running each value of `map` thru `fn`. - */ -export default function mapValue(map, fn) { - var result = Object.create(null); - - for (var _i2 = 0, _objectEntries2 = objectEntries(map); _i2 < _objectEntries2.length; _i2++) { - var _ref2 = _objectEntries2[_i2]; - var _key = _ref2[0]; - var _value = _ref2[1]; - result[_key] = fn(_value, _key); - } - - return result; -} diff --git a/school/node_modules/graphql/jsutils/memoize3.js b/school/node_modules/graphql/jsutils/memoize3.js deleted file mode 100644 index db98f3f..0000000 --- a/school/node_modules/graphql/jsutils/memoize3.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = memoize3; - -/** - * Memoizes the provided three-argument function. - */ -function memoize3(fn) { - var cache0; - return function memoized(a1, a2, a3) { - if (!cache0) { - cache0 = new WeakMap(); - } - - var cache1 = cache0.get(a1); - var cache2; - - if (cache1) { - cache2 = cache1.get(a2); - - if (cache2) { - var cachedValue = cache2.get(a3); - - if (cachedValue !== undefined) { - return cachedValue; - } - } - } else { - cache1 = new WeakMap(); - cache0.set(a1, cache1); - } - - if (!cache2) { - cache2 = new WeakMap(); - cache1.set(a2, cache2); - } - - var newValue = fn(a1, a2, a3); - cache2.set(a3, newValue); - return newValue; - }; -} diff --git a/school/node_modules/graphql/jsutils/memoize3.js.flow b/school/node_modules/graphql/jsutils/memoize3.js.flow deleted file mode 100644 index cd4ccd5..0000000 --- a/school/node_modules/graphql/jsutils/memoize3.js.flow +++ /dev/null @@ -1,39 +0,0 @@ -// @flow strict -/** - * Memoizes the provided three-argument function. - */ -export default function memoize3< - A1: { ... } | $ReadOnlyArray<mixed>, - A2: { ... } | $ReadOnlyArray<mixed>, - A3: { ... } | $ReadOnlyArray<mixed>, - R: mixed, ->(fn: (A1, A2, A3) => R): (A1, A2, A3) => R { - let cache0; - - return function memoized(a1, a2, a3) { - if (!cache0) { - cache0 = new WeakMap(); - } - let cache1 = cache0.get(a1); - let cache2; - if (cache1) { - cache2 = cache1.get(a2); - if (cache2) { - const cachedValue = cache2.get(a3); - if (cachedValue !== undefined) { - return cachedValue; - } - } - } else { - cache1 = new WeakMap(); - cache0.set(a1, cache1); - } - if (!cache2) { - cache2 = new WeakMap(); - cache1.set(a2, cache2); - } - const newValue = fn(a1, a2, a3); - cache2.set(a3, newValue); - return newValue; - }; -} diff --git a/school/node_modules/graphql/jsutils/memoize3.mjs b/school/node_modules/graphql/jsutils/memoize3.mjs deleted file mode 100644 index cfaeb77..0000000 --- a/school/node_modules/graphql/jsutils/memoize3.mjs +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Memoizes the provided three-argument function. - */ -export default function memoize3(fn) { - var cache0; - return function memoized(a1, a2, a3) { - if (!cache0) { - cache0 = new WeakMap(); - } - - var cache1 = cache0.get(a1); - var cache2; - - if (cache1) { - cache2 = cache1.get(a2); - - if (cache2) { - var cachedValue = cache2.get(a3); - - if (cachedValue !== undefined) { - return cachedValue; - } - } - } else { - cache1 = new WeakMap(); - cache0.set(a1, cache1); - } - - if (!cache2) { - cache2 = new WeakMap(); - cache1.set(a2, cache2); - } - - var newValue = fn(a1, a2, a3); - cache2.set(a3, newValue); - return newValue; - }; -} diff --git a/school/node_modules/graphql/jsutils/naturalCompare.js b/school/node_modules/graphql/jsutils/naturalCompare.js deleted file mode 100644 index bd8ef34..0000000 --- a/school/node_modules/graphql/jsutils/naturalCompare.js +++ /dev/null @@ -1,69 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = naturalCompare; - -/** - * Returns a number indicating whether a reference string comes before, or after, - * or is the same as the given string in natural sort order. - * - * See: https://en.wikipedia.org/wiki/Natural_sort_order - * - */ -function naturalCompare(aStr, bStr) { - var aIdx = 0; - var bIdx = 0; - - while (aIdx < aStr.length && bIdx < bStr.length) { - var aChar = aStr.charCodeAt(aIdx); - var bChar = bStr.charCodeAt(bIdx); - - if (isDigit(aChar) && isDigit(bChar)) { - var aNum = 0; - - do { - ++aIdx; - aNum = aNum * 10 + aChar - DIGIT_0; - aChar = aStr.charCodeAt(aIdx); - } while (isDigit(aChar) && aNum > 0); - - var bNum = 0; - - do { - ++bIdx; - bNum = bNum * 10 + bChar - DIGIT_0; - bChar = bStr.charCodeAt(bIdx); - } while (isDigit(bChar) && bNum > 0); - - if (aNum < bNum) { - return -1; - } - - if (aNum > bNum) { - return 1; - } - } else { - if (aChar < bChar) { - return -1; - } - - if (aChar > bChar) { - return 1; - } - - ++aIdx; - ++bIdx; - } - } - - return aStr.length - bStr.length; -} - -var DIGIT_0 = 48; -var DIGIT_9 = 57; - -function isDigit(code) { - return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9; -} diff --git a/school/node_modules/graphql/jsutils/naturalCompare.js.flow b/school/node_modules/graphql/jsutils/naturalCompare.js.flow deleted file mode 100644 index 556e613..0000000 --- a/school/node_modules/graphql/jsutils/naturalCompare.js.flow +++ /dev/null @@ -1,59 +0,0 @@ -// @flow strict -/** - * Returns a number indicating whether a reference string comes before, or after, - * or is the same as the given string in natural sort order. - * - * See: https://en.wikipedia.org/wiki/Natural_sort_order - * - */ -export default function naturalCompare(aStr: string, bStr: string): number { - let aIdx = 0; - let bIdx = 0; - - while (aIdx < aStr.length && bIdx < bStr.length) { - let aChar = aStr.charCodeAt(aIdx); - let bChar = bStr.charCodeAt(bIdx); - - if (isDigit(aChar) && isDigit(bChar)) { - let aNum = 0; - do { - ++aIdx; - aNum = aNum * 10 + aChar - DIGIT_0; - aChar = aStr.charCodeAt(aIdx); - } while (isDigit(aChar) && aNum > 0); - - let bNum = 0; - do { - ++bIdx; - bNum = bNum * 10 + bChar - DIGIT_0; - bChar = bStr.charCodeAt(bIdx); - } while (isDigit(bChar) && bNum > 0); - - if (aNum < bNum) { - return -1; - } - - if (aNum > bNum) { - return 1; - } - } else { - if (aChar < bChar) { - return -1; - } - if (aChar > bChar) { - return 1; - } - ++aIdx; - ++bIdx; - } - } - - return aStr.length - bStr.length; -} - -const DIGIT_0 = 48; -const DIGIT_9 = 57; - -function isDigit(code: number): boolean { - return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9; -} diff --git a/school/node_modules/graphql/jsutils/naturalCompare.mjs b/school/node_modules/graphql/jsutils/naturalCompare.mjs deleted file mode 100644 index 4313627..0000000 --- a/school/node_modules/graphql/jsutils/naturalCompare.mjs +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Returns a number indicating whether a reference string comes before, or after, - * or is the same as the given string in natural sort order. - * - * See: https://en.wikipedia.org/wiki/Natural_sort_order - * - */ -export default function naturalCompare(aStr, bStr) { - var aIdx = 0; - var bIdx = 0; - - while (aIdx < aStr.length && bIdx < bStr.length) { - var aChar = aStr.charCodeAt(aIdx); - var bChar = bStr.charCodeAt(bIdx); - - if (isDigit(aChar) && isDigit(bChar)) { - var aNum = 0; - - do { - ++aIdx; - aNum = aNum * 10 + aChar - DIGIT_0; - aChar = aStr.charCodeAt(aIdx); - } while (isDigit(aChar) && aNum > 0); - - var bNum = 0; - - do { - ++bIdx; - bNum = bNum * 10 + bChar - DIGIT_0; - bChar = bStr.charCodeAt(bIdx); - } while (isDigit(bChar) && bNum > 0); - - if (aNum < bNum) { - return -1; - } - - if (aNum > bNum) { - return 1; - } - } else { - if (aChar < bChar) { - return -1; - } - - if (aChar > bChar) { - return 1; - } - - ++aIdx; - ++bIdx; - } - } - - return aStr.length - bStr.length; -} -var DIGIT_0 = 48; -var DIGIT_9 = 57; - -function isDigit(code) { - return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9; -} diff --git a/school/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js b/school/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js deleted file mode 100644 index 3a12833..0000000 --- a/school/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') -var nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined; -var _default = nodejsCustomInspectSymbol; -exports.default = _default; diff --git a/school/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js.flow b/school/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js.flow deleted file mode 100644 index 114489c..0000000 --- a/school/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js.flow +++ /dev/null @@ -1,8 +0,0 @@ -// @flow strict -// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') -const nodejsCustomInspectSymbol = - typeof Symbol === 'function' && typeof Symbol.for === 'function' - ? Symbol.for('nodejs.util.inspect.custom') - : undefined; - -export default nodejsCustomInspectSymbol; diff --git a/school/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs b/school/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs deleted file mode 100644 index afaf3e6..0000000 --- a/school/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs +++ /dev/null @@ -1,3 +0,0 @@ -// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') -var nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined; -export default nodejsCustomInspectSymbol; diff --git a/school/node_modules/graphql/jsutils/printPathArray.js b/school/node_modules/graphql/jsutils/printPathArray.js deleted file mode 100644 index 31224eb..0000000 --- a/school/node_modules/graphql/jsutils/printPathArray.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = printPathArray; - -/** - * Build a string describing the path. - */ -function printPathArray(path) { - return path.map(function (key) { - return typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key; - }).join(''); -} diff --git a/school/node_modules/graphql/jsutils/printPathArray.js.flow b/school/node_modules/graphql/jsutils/printPathArray.js.flow deleted file mode 100644 index 552a415..0000000 --- a/school/node_modules/graphql/jsutils/printPathArray.js.flow +++ /dev/null @@ -1,13 +0,0 @@ -// @flow strict -/** - * Build a string describing the path. - */ -export default function printPathArray( - path: $ReadOnlyArray<string | number>, -): string { - return path - .map((key) => - typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key, - ) - .join(''); -} diff --git a/school/node_modules/graphql/jsutils/printPathArray.mjs b/school/node_modules/graphql/jsutils/printPathArray.mjs deleted file mode 100644 index 6bf077a..0000000 --- a/school/node_modules/graphql/jsutils/printPathArray.mjs +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Build a string describing the path. - */ -export default function printPathArray(path) { - return path.map(function (key) { - return typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key; - }).join(''); -} diff --git a/school/node_modules/graphql/jsutils/promiseForObject.js b/school/node_modules/graphql/jsutils/promiseForObject.js deleted file mode 100644 index f291f9b..0000000 --- a/school/node_modules/graphql/jsutils/promiseForObject.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = promiseForObject; - -/** - * This function transforms a JS object `ObjMap<Promise<T>>` into - * a `Promise<ObjMap<T>>` - * - * This is akin to bluebird's `Promise.props`, but implemented only using - * `Promise.all` so it will work with any implementation of ES6 promises. - */ -function promiseForObject(object) { - var keys = Object.keys(object); - var valuesAndPromises = keys.map(function (name) { - return object[name]; - }); - return Promise.all(valuesAndPromises).then(function (values) { - return values.reduce(function (resolvedObject, value, i) { - resolvedObject[keys[i]] = value; - return resolvedObject; - }, Object.create(null)); - }); -} diff --git a/school/node_modules/graphql/jsutils/promiseForObject.js.flow b/school/node_modules/graphql/jsutils/promiseForObject.js.flow deleted file mode 100644 index 5c2c65b..0000000 --- a/school/node_modules/graphql/jsutils/promiseForObject.js.flow +++ /dev/null @@ -1,22 +0,0 @@ -// @flow strict -import type { ObjMap } from './ObjMap'; - -/** - * This function transforms a JS object `ObjMap<Promise<T>>` into - * a `Promise<ObjMap<T>>` - * - * This is akin to bluebird's `Promise.props`, but implemented only using - * `Promise.all` so it will work with any implementation of ES6 promises. - */ -export default function promiseForObject<T>( - object: ObjMap<Promise<T>>, -): Promise<ObjMap<T>> { - const keys = Object.keys(object); - const valuesAndPromises = keys.map((name) => object[name]); - return Promise.all(valuesAndPromises).then((values) => - values.reduce((resolvedObject, value, i) => { - resolvedObject[keys[i]] = value; - return resolvedObject; - }, Object.create(null)), - ); -} diff --git a/school/node_modules/graphql/jsutils/promiseForObject.mjs b/school/node_modules/graphql/jsutils/promiseForObject.mjs deleted file mode 100644 index ee36ed4..0000000 --- a/school/node_modules/graphql/jsutils/promiseForObject.mjs +++ /dev/null @@ -1,19 +0,0 @@ -/** - * This function transforms a JS object `ObjMap<Promise<T>>` into - * a `Promise<ObjMap<T>>` - * - * This is akin to bluebird's `Promise.props`, but implemented only using - * `Promise.all` so it will work with any implementation of ES6 promises. - */ -export default function promiseForObject(object) { - var keys = Object.keys(object); - var valuesAndPromises = keys.map(function (name) { - return object[name]; - }); - return Promise.all(valuesAndPromises).then(function (values) { - return values.reduce(function (resolvedObject, value, i) { - resolvedObject[keys[i]] = value; - return resolvedObject; - }, Object.create(null)); - }); -} diff --git a/school/node_modules/graphql/jsutils/promiseReduce.js b/school/node_modules/graphql/jsutils/promiseReduce.js deleted file mode 100644 index 6606926..0000000 --- a/school/node_modules/graphql/jsutils/promiseReduce.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = promiseReduce; - -var _isPromise = _interopRequireDefault(require("./isPromise.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Similar to Array.prototype.reduce(), however the reducing callback may return - * a Promise, in which case reduction will continue after each promise resolves. - * - * If the callback does not return a Promise, then this function will also not - * return a Promise. - */ -function promiseReduce(values, callback, initialValue) { - return values.reduce(function (previous, value) { - return (0, _isPromise.default)(previous) ? previous.then(function (resolved) { - return callback(resolved, value); - }) : callback(previous, value); - }, initialValue); -} diff --git a/school/node_modules/graphql/jsutils/promiseReduce.js.flow b/school/node_modules/graphql/jsutils/promiseReduce.js.flow deleted file mode 100644 index ea333bc..0000000 --- a/school/node_modules/graphql/jsutils/promiseReduce.js.flow +++ /dev/null @@ -1,25 +0,0 @@ -// @flow strict -import type { PromiseOrValue } from './PromiseOrValue'; - -import isPromise from './isPromise'; - -/** - * Similar to Array.prototype.reduce(), however the reducing callback may return - * a Promise, in which case reduction will continue after each promise resolves. - * - * If the callback does not return a Promise, then this function will also not - * return a Promise. - */ -export default function promiseReduce<T, U>( - values: $ReadOnlyArray<T>, - callback: (U, T) => PromiseOrValue<U>, - initialValue: PromiseOrValue<U>, -): PromiseOrValue<U> { - return values.reduce( - (previous, value) => - isPromise(previous) - ? previous.then((resolved) => callback(resolved, value)) - : callback(previous, value), - initialValue, - ); -} diff --git a/school/node_modules/graphql/jsutils/promiseReduce.mjs b/school/node_modules/graphql/jsutils/promiseReduce.mjs deleted file mode 100644 index db99d5d..0000000 --- a/school/node_modules/graphql/jsutils/promiseReduce.mjs +++ /dev/null @@ -1,16 +0,0 @@ -import isPromise from "./isPromise.mjs"; -/** - * Similar to Array.prototype.reduce(), however the reducing callback may return - * a Promise, in which case reduction will continue after each promise resolves. - * - * If the callback does not return a Promise, then this function will also not - * return a Promise. - */ - -export default function promiseReduce(values, callback, initialValue) { - return values.reduce(function (previous, value) { - return isPromise(previous) ? previous.then(function (resolved) { - return callback(resolved, value); - }) : callback(previous, value); - }, initialValue); -} diff --git a/school/node_modules/graphql/jsutils/safeArrayFrom.js b/school/node_modules/graphql/jsutils/safeArrayFrom.js deleted file mode 100644 index 3c80dee..0000000 --- a/school/node_modules/graphql/jsutils/safeArrayFrom.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = safeArrayFrom; - -var _symbols = require("../polyfills/symbols.js"); - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -/** - * Safer version of `Array.from` that return `null` if value isn't convertible to array. - * Also protects against Array-like objects without items. - * - * @example - * - * safeArrayFrom([ 1, 2, 3 ]) // [1, 2, 3] - * safeArrayFrom('ABC') // null - * safeArrayFrom({ length: 1 }) // null - * safeArrayFrom({ length: 1, 0: 'Alpha' }) // ['Alpha'] - * safeArrayFrom({ key: 'value' }) // null - * safeArrayFrom(new Map()) // [] - * - */ -function safeArrayFrom(collection) { - var mapFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (item) { - return item; - }; - - if (collection == null || _typeof(collection) !== 'object') { - return null; - } - - if (Array.isArray(collection)) { - return collection.map(mapFn); - } // Is Iterable? - - - var iteratorMethod = collection[_symbols.SYMBOL_ITERATOR]; - - if (typeof iteratorMethod === 'function') { - // $FlowFixMe[incompatible-use] - var iterator = iteratorMethod.call(collection); - var result = []; - var step; - - for (var i = 0; !(step = iterator.next()).done; ++i) { - result.push(mapFn(step.value, i)); - } - - return result; - } // Is Array like? - - - var length = collection.length; - - if (typeof length === 'number' && length >= 0 && length % 1 === 0) { - var _result = []; - - for (var _i = 0; _i < length; ++_i) { - if (!Object.prototype.hasOwnProperty.call(collection, _i)) { - return null; - } - - _result.push(mapFn(collection[String(_i)], _i)); - } - - return _result; - } - - return null; -} diff --git a/school/node_modules/graphql/jsutils/safeArrayFrom.js.flow b/school/node_modules/graphql/jsutils/safeArrayFrom.js.flow deleted file mode 100644 index db2bdea..0000000 --- a/school/node_modules/graphql/jsutils/safeArrayFrom.js.flow +++ /dev/null @@ -1,59 +0,0 @@ -// @flow strict -import { SYMBOL_ITERATOR } from '../polyfills/symbols'; - -/** - * Safer version of `Array.from` that return `null` if value isn't convertible to array. - * Also protects against Array-like objects without items. - * - * @example - * - * safeArrayFrom([ 1, 2, 3 ]) // [1, 2, 3] - * safeArrayFrom('ABC') // null - * safeArrayFrom({ length: 1 }) // null - * safeArrayFrom({ length: 1, 0: 'Alpha' }) // ['Alpha'] - * safeArrayFrom({ key: 'value' }) // null - * safeArrayFrom(new Map()) // [] - * - */ -export default function safeArrayFrom<T>( - collection: mixed, - mapFn: (elem: mixed, index: number) => T = (item) => ((item: any): T), -): Array<T> | null { - if (collection == null || typeof collection !== 'object') { - return null; - } - - if (Array.isArray(collection)) { - return collection.map(mapFn); - } - - // Is Iterable? - const iteratorMethod = collection[SYMBOL_ITERATOR]; - if (typeof iteratorMethod === 'function') { - // $FlowFixMe[incompatible-use] - const iterator = iteratorMethod.call(collection); - const result = []; - let step; - - for (let i = 0; !(step = iterator.next()).done; ++i) { - result.push(mapFn(step.value, i)); - } - return result; - } - - // Is Array like? - const length = collection.length; - if (typeof length === 'number' && length >= 0 && length % 1 === 0) { - const result = []; - for (let i = 0; i < length; ++i) { - if (!Object.prototype.hasOwnProperty.call(collection, i)) { - return null; - } - result.push(mapFn(collection[String(i)], i)); - } - - return result; - } - - return null; -} diff --git a/school/node_modules/graphql/jsutils/safeArrayFrom.mjs b/school/node_modules/graphql/jsutils/safeArrayFrom.mjs deleted file mode 100644 index f8b357d..0000000 --- a/school/node_modules/graphql/jsutils/safeArrayFrom.mjs +++ /dev/null @@ -1,66 +0,0 @@ -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -import { SYMBOL_ITERATOR } from "../polyfills/symbols.mjs"; -/** - * Safer version of `Array.from` that return `null` if value isn't convertible to array. - * Also protects against Array-like objects without items. - * - * @example - * - * safeArrayFrom([ 1, 2, 3 ]) // [1, 2, 3] - * safeArrayFrom('ABC') // null - * safeArrayFrom({ length: 1 }) // null - * safeArrayFrom({ length: 1, 0: 'Alpha' }) // ['Alpha'] - * safeArrayFrom({ key: 'value' }) // null - * safeArrayFrom(new Map()) // [] - * - */ - -export default function safeArrayFrom(collection) { - var mapFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (item) { - return item; - }; - - if (collection == null || _typeof(collection) !== 'object') { - return null; - } - - if (Array.isArray(collection)) { - return collection.map(mapFn); - } // Is Iterable? - - - var iteratorMethod = collection[SYMBOL_ITERATOR]; - - if (typeof iteratorMethod === 'function') { - // $FlowFixMe[incompatible-use] - var iterator = iteratorMethod.call(collection); - var result = []; - var step; - - for (var i = 0; !(step = iterator.next()).done; ++i) { - result.push(mapFn(step.value, i)); - } - - return result; - } // Is Array like? - - - var length = collection.length; - - if (typeof length === 'number' && length >= 0 && length % 1 === 0) { - var _result = []; - - for (var _i = 0; _i < length; ++_i) { - if (!Object.prototype.hasOwnProperty.call(collection, _i)) { - return null; - } - - _result.push(mapFn(collection[String(_i)], _i)); - } - - return _result; - } - - return null; -} diff --git a/school/node_modules/graphql/jsutils/suggestionList.js b/school/node_modules/graphql/jsutils/suggestionList.js deleted file mode 100644 index 6d38ff6..0000000 --- a/school/node_modules/graphql/jsutils/suggestionList.js +++ /dev/null @@ -1,141 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = suggestionList; - -var _naturalCompare = _interopRequireDefault(require("./naturalCompare.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Given an invalid input string and a list of valid options, returns a filtered - * list of valid options sorted based on their similarity with the input. - */ -function suggestionList(input, options) { - var optionsByDistance = Object.create(null); - var lexicalDistance = new LexicalDistance(input); - var threshold = Math.floor(input.length * 0.4) + 1; - - for (var _i2 = 0; _i2 < options.length; _i2++) { - var option = options[_i2]; - var distance = lexicalDistance.measure(option, threshold); - - if (distance !== undefined) { - optionsByDistance[option] = distance; - } - } - - return Object.keys(optionsByDistance).sort(function (a, b) { - var distanceDiff = optionsByDistance[a] - optionsByDistance[b]; - return distanceDiff !== 0 ? distanceDiff : (0, _naturalCompare.default)(a, b); - }); -} -/** - * Computes the lexical distance between strings A and B. - * - * The "distance" between two strings is given by counting the minimum number - * of edits needed to transform string A into string B. An edit can be an - * insertion, deletion, or substitution of a single character, or a swap of two - * adjacent characters. - * - * Includes a custom alteration from Damerau-Levenshtein to treat case changes - * as a single edit which helps identify mis-cased values with an edit distance - * of 1. - * - * This distance can be useful for detecting typos in input or sorting - */ - - -var LexicalDistance = /*#__PURE__*/function () { - function LexicalDistance(input) { - this._input = input; - this._inputLowerCase = input.toLowerCase(); - this._inputArray = stringToArray(this._inputLowerCase); - this._rows = [new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0)]; - } - - var _proto = LexicalDistance.prototype; - - _proto.measure = function measure(option, threshold) { - if (this._input === option) { - return 0; - } - - var optionLowerCase = option.toLowerCase(); // Any case change counts as a single edit - - if (this._inputLowerCase === optionLowerCase) { - return 1; - } - - var a = stringToArray(optionLowerCase); - var b = this._inputArray; - - if (a.length < b.length) { - var tmp = a; - a = b; - b = tmp; - } - - var aLength = a.length; - var bLength = b.length; - - if (aLength - bLength > threshold) { - return undefined; - } - - var rows = this._rows; - - for (var j = 0; j <= bLength; j++) { - rows[0][j] = j; - } - - for (var i = 1; i <= aLength; i++) { - var upRow = rows[(i - 1) % 3]; - var currentRow = rows[i % 3]; - var smallestCell = currentRow[0] = i; - - for (var _j = 1; _j <= bLength; _j++) { - var cost = a[i - 1] === b[_j - 1] ? 0 : 1; - var currentCell = Math.min(upRow[_j] + 1, // delete - currentRow[_j - 1] + 1, // insert - upRow[_j - 1] + cost // substitute - ); - - if (i > 1 && _j > 1 && a[i - 1] === b[_j - 2] && a[i - 2] === b[_j - 1]) { - // transposition - var doubleDiagonalCell = rows[(i - 2) % 3][_j - 2]; - currentCell = Math.min(currentCell, doubleDiagonalCell + 1); - } - - if (currentCell < smallestCell) { - smallestCell = currentCell; - } - - currentRow[_j] = currentCell; - } // Early exit, since distance can't go smaller than smallest element of the previous row. - - - if (smallestCell > threshold) { - return undefined; - } - } - - var distance = rows[aLength % 3][bLength]; - return distance <= threshold ? distance : undefined; - }; - - return LexicalDistance; -}(); - -function stringToArray(str) { - var strLength = str.length; - var array = new Array(strLength); - - for (var i = 0; i < strLength; ++i) { - array[i] = str.charCodeAt(i); - } - - return array; -} diff --git a/school/node_modules/graphql/jsutils/suggestionList.js.flow b/school/node_modules/graphql/jsutils/suggestionList.js.flow deleted file mode 100644 index 017e779..0000000 --- a/school/node_modules/graphql/jsutils/suggestionList.js.flow +++ /dev/null @@ -1,138 +0,0 @@ -// @flow strict -import naturalCompare from './naturalCompare'; - -/** - * Given an invalid input string and a list of valid options, returns a filtered - * list of valid options sorted based on their similarity with the input. - */ -export default function suggestionList( - input: string, - options: $ReadOnlyArray<string>, -): Array<string> { - const optionsByDistance = Object.create(null); - const lexicalDistance = new LexicalDistance(input); - - const threshold = Math.floor(input.length * 0.4) + 1; - for (const option of options) { - const distance = lexicalDistance.measure(option, threshold); - if (distance !== undefined) { - optionsByDistance[option] = distance; - } - } - - return Object.keys(optionsByDistance).sort((a, b) => { - const distanceDiff = optionsByDistance[a] - optionsByDistance[b]; - return distanceDiff !== 0 ? distanceDiff : naturalCompare(a, b); - }); -} - -/** - * Computes the lexical distance between strings A and B. - * - * The "distance" between two strings is given by counting the minimum number - * of edits needed to transform string A into string B. An edit can be an - * insertion, deletion, or substitution of a single character, or a swap of two - * adjacent characters. - * - * Includes a custom alteration from Damerau-Levenshtein to treat case changes - * as a single edit which helps identify mis-cased values with an edit distance - * of 1. - * - * This distance can be useful for detecting typos in input or sorting - */ -class LexicalDistance { - _input: string; - _inputLowerCase: string; - _inputArray: Array<number>; - _rows: [Array<number>, Array<number>, Array<number>]; - - constructor(input: string) { - this._input = input; - this._inputLowerCase = input.toLowerCase(); - this._inputArray = stringToArray(this._inputLowerCase); - - this._rows = [ - new Array(input.length + 1).fill(0), - new Array(input.length + 1).fill(0), - new Array(input.length + 1).fill(0), - ]; - } - - measure(option: string, threshold: number): number | void { - if (this._input === option) { - return 0; - } - - const optionLowerCase = option.toLowerCase(); - - // Any case change counts as a single edit - if (this._inputLowerCase === optionLowerCase) { - return 1; - } - - let a = stringToArray(optionLowerCase); - let b = this._inputArray; - - if (a.length < b.length) { - const tmp = a; - a = b; - b = tmp; - } - const aLength = a.length; - const bLength = b.length; - - if (aLength - bLength > threshold) { - return undefined; - } - - const rows = this._rows; - for (let j = 0; j <= bLength; j++) { - rows[0][j] = j; - } - - for (let i = 1; i <= aLength; i++) { - const upRow = rows[(i - 1) % 3]; - const currentRow = rows[i % 3]; - - let smallestCell = (currentRow[0] = i); - for (let j = 1; j <= bLength; j++) { - const cost = a[i - 1] === b[j - 1] ? 0 : 1; - - let currentCell = Math.min( - upRow[j] + 1, // delete - currentRow[j - 1] + 1, // insert - upRow[j - 1] + cost, // substitute - ); - - if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) { - // transposition - const doubleDiagonalCell = rows[(i - 2) % 3][j - 2]; - currentCell = Math.min(currentCell, doubleDiagonalCell + 1); - } - - if (currentCell < smallestCell) { - smallestCell = currentCell; - } - - currentRow[j] = currentCell; - } - - // Early exit, since distance can't go smaller than smallest element of the previous row. - if (smallestCell > threshold) { - return undefined; - } - } - - const distance = rows[aLength % 3][bLength]; - return distance <= threshold ? distance : undefined; - } -} - -function stringToArray(str: string): Array<number> { - const strLength = str.length; - const array = new Array(strLength); - for (let i = 0; i < strLength; ++i) { - array[i] = str.charCodeAt(i); - } - return array; -} diff --git a/school/node_modules/graphql/jsutils/suggestionList.mjs b/school/node_modules/graphql/jsutils/suggestionList.mjs deleted file mode 100644 index 154560a..0000000 --- a/school/node_modules/graphql/jsutils/suggestionList.mjs +++ /dev/null @@ -1,131 +0,0 @@ -import naturalCompare from "./naturalCompare.mjs"; -/** - * Given an invalid input string and a list of valid options, returns a filtered - * list of valid options sorted based on their similarity with the input. - */ - -export default function suggestionList(input, options) { - var optionsByDistance = Object.create(null); - var lexicalDistance = new LexicalDistance(input); - var threshold = Math.floor(input.length * 0.4) + 1; - - for (var _i2 = 0; _i2 < options.length; _i2++) { - var option = options[_i2]; - var distance = lexicalDistance.measure(option, threshold); - - if (distance !== undefined) { - optionsByDistance[option] = distance; - } - } - - return Object.keys(optionsByDistance).sort(function (a, b) { - var distanceDiff = optionsByDistance[a] - optionsByDistance[b]; - return distanceDiff !== 0 ? distanceDiff : naturalCompare(a, b); - }); -} -/** - * Computes the lexical distance between strings A and B. - * - * The "distance" between two strings is given by counting the minimum number - * of edits needed to transform string A into string B. An edit can be an - * insertion, deletion, or substitution of a single character, or a swap of two - * adjacent characters. - * - * Includes a custom alteration from Damerau-Levenshtein to treat case changes - * as a single edit which helps identify mis-cased values with an edit distance - * of 1. - * - * This distance can be useful for detecting typos in input or sorting - */ - -var LexicalDistance = /*#__PURE__*/function () { - function LexicalDistance(input) { - this._input = input; - this._inputLowerCase = input.toLowerCase(); - this._inputArray = stringToArray(this._inputLowerCase); - this._rows = [new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0)]; - } - - var _proto = LexicalDistance.prototype; - - _proto.measure = function measure(option, threshold) { - if (this._input === option) { - return 0; - } - - var optionLowerCase = option.toLowerCase(); // Any case change counts as a single edit - - if (this._inputLowerCase === optionLowerCase) { - return 1; - } - - var a = stringToArray(optionLowerCase); - var b = this._inputArray; - - if (a.length < b.length) { - var tmp = a; - a = b; - b = tmp; - } - - var aLength = a.length; - var bLength = b.length; - - if (aLength - bLength > threshold) { - return undefined; - } - - var rows = this._rows; - - for (var j = 0; j <= bLength; j++) { - rows[0][j] = j; - } - - for (var i = 1; i <= aLength; i++) { - var upRow = rows[(i - 1) % 3]; - var currentRow = rows[i % 3]; - var smallestCell = currentRow[0] = i; - - for (var _j = 1; _j <= bLength; _j++) { - var cost = a[i - 1] === b[_j - 1] ? 0 : 1; - var currentCell = Math.min(upRow[_j] + 1, // delete - currentRow[_j - 1] + 1, // insert - upRow[_j - 1] + cost // substitute - ); - - if (i > 1 && _j > 1 && a[i - 1] === b[_j - 2] && a[i - 2] === b[_j - 1]) { - // transposition - var doubleDiagonalCell = rows[(i - 2) % 3][_j - 2]; - currentCell = Math.min(currentCell, doubleDiagonalCell + 1); - } - - if (currentCell < smallestCell) { - smallestCell = currentCell; - } - - currentRow[_j] = currentCell; - } // Early exit, since distance can't go smaller than smallest element of the previous row. - - - if (smallestCell > threshold) { - return undefined; - } - } - - var distance = rows[aLength % 3][bLength]; - return distance <= threshold ? distance : undefined; - }; - - return LexicalDistance; -}(); - -function stringToArray(str) { - var strLength = str.length; - var array = new Array(strLength); - - for (var i = 0; i < strLength; ++i) { - array[i] = str.charCodeAt(i); - } - - return array; -} diff --git a/school/node_modules/graphql/jsutils/toObjMap.js b/school/node_modules/graphql/jsutils/toObjMap.js deleted file mode 100644 index 1768d74..0000000 --- a/school/node_modules/graphql/jsutils/toObjMap.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = toObjMap; - -var _objectEntries3 = _interopRequireDefault(require("../polyfills/objectEntries.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function toObjMap(obj) { - /* eslint-enable no-redeclare */ - if (Object.getPrototypeOf(obj) === null) { - return obj; - } - - var map = Object.create(null); - - for (var _i2 = 0, _objectEntries2 = (0, _objectEntries3.default)(obj); _i2 < _objectEntries2.length; _i2++) { - var _ref2 = _objectEntries2[_i2]; - var key = _ref2[0]; - var value = _ref2[1]; - map[key] = value; - } - - return map; -} diff --git a/school/node_modules/graphql/jsutils/toObjMap.js.flow b/school/node_modules/graphql/jsutils/toObjMap.js.flow deleted file mode 100644 index 81c1113..0000000 --- a/school/node_modules/graphql/jsutils/toObjMap.js.flow +++ /dev/null @@ -1,26 +0,0 @@ -// @flow strict -import objectEntries from '../polyfills/objectEntries'; - -import type { - ObjMap, - ObjMapLike, - ReadOnlyObjMap, - ReadOnlyObjMapLike, -} from './ObjMap'; - -/* eslint-disable no-redeclare */ -declare function toObjMap<T>(obj: ObjMapLike<T>): ObjMap<T>; -declare function toObjMap<T>(obj: ReadOnlyObjMapLike<T>): ReadOnlyObjMap<T>; - -export default function toObjMap(obj) { - /* eslint-enable no-redeclare */ - if (Object.getPrototypeOf(obj) === null) { - return obj; - } - - const map = Object.create(null); - for (const [key, value] of objectEntries(obj)) { - map[key] = value; - } - return map; -} diff --git a/school/node_modules/graphql/jsutils/toObjMap.mjs b/school/node_modules/graphql/jsutils/toObjMap.mjs deleted file mode 100644 index b0ddf05..0000000 --- a/school/node_modules/graphql/jsutils/toObjMap.mjs +++ /dev/null @@ -1,18 +0,0 @@ -import objectEntries from "../polyfills/objectEntries.mjs"; -export default function toObjMap(obj) { - /* eslint-enable no-redeclare */ - if (Object.getPrototypeOf(obj) === null) { - return obj; - } - - var map = Object.create(null); - - for (var _i2 = 0, _objectEntries2 = objectEntries(obj); _i2 < _objectEntries2.length; _i2++) { - var _ref2 = _objectEntries2[_i2]; - var key = _ref2[0]; - var value = _ref2[1]; - map[key] = value; - } - - return map; -} |