Initial Save

This commit is contained in:
jackbeeby
2025-03-28 12:30:19 +11:00
parent e381994f19
commit d8773925e8
9910 changed files with 982718 additions and 0 deletions

1
node_modules/graphql/jsutils/ObjMap.js generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";

9
node_modules/graphql/jsutils/ObjMap.js.flow generated vendored Normal file
View File

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

1
node_modules/graphql/jsutils/ObjMap.mjs generated vendored Normal file
View File

@@ -0,0 +1 @@

14
node_modules/graphql/jsutils/Path.d.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
export type Path = {
prev: Path | undefined;
key: string | number;
};
/**
* Given a Path and a key, return a new Path containing the new key.
*/
export function addPath(prev: Path | undefined, key: string | number): Path;
/**
* Given a Path, return an Array of the path keys.
*/
export function pathToArray(path: Path): Array<string | number>;

33
node_modules/graphql/jsutils/Path.js generated vendored Normal file
View File

@@ -0,0 +1,33 @@
"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) {
return {
prev: prev,
key: key
};
}
/**
* 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();
}

26
node_modules/graphql/jsutils/Path.js.flow generated vendored Normal file
View File

@@ -0,0 +1,26 @@
// @flow strict
export type Path = {|
+prev: Path | void,
+key: string | number,
|};
/**
* Given a Path and a key, return a new Path containing the new key.
*/
export function addPath(prev: $ReadOnly<Path> | void, key: string | number) {
return { prev, key };
}
/**
* 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();
}

24
node_modules/graphql/jsutils/Path.mjs generated vendored Normal file
View File

@@ -0,0 +1,24 @@
/**
* Given a Path and a key, return a new Path containing the new key.
*/
export function addPath(prev, key) {
return {
prev: prev,
key: key
};
}
/**
* 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();
}

1
node_modules/graphql/jsutils/PromiseOrValue.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export type PromiseOrValue<T> = Promise<T> | T;

1
node_modules/graphql/jsutils/PromiseOrValue.js generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";

3
node_modules/graphql/jsutils/PromiseOrValue.js.flow generated vendored Normal file
View File

@@ -0,0 +1,3 @@
// @flow strict
export type PromiseOrValue<+T> = Promise<T> | T;

1
node_modules/graphql/jsutils/PromiseOrValue.mjs generated vendored Normal file
View File

@@ -0,0 +1 @@

48
node_modules/graphql/jsutils/dedent.js generated vendored Normal file
View File

@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = dedent;
/**
* An ES6 string tag that fixes indentation. Also removes leading newlines
* and trailing spaces and tabs, but keeps trailing newlines.
*
* Example usage:
* const str = dedent`
* {
* test
* }
* `;
* str === "{\n test\n}\n";
*/
function dedent(strings) {
var str = '';
for (var i = 0; i < strings.length; ++i) {
str += strings[i];
if (i < (arguments.length <= 1 ? 0 : arguments.length - 1)) {
str += i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1]; // interpolation
}
}
var trimmedStr = str.replace(/^\n*/m, '') // remove leading newline
.replace(/[ \t]*$/, ''); // remove trailing spaces and tabs
// fixes indentation by removing leading spaces and tabs from each line
var indent = '';
for (var _i2 = 0; _i2 < trimmedStr.length; _i2++) {
var char = trimmedStr[_i2];
if (char !== ' ' && char !== '\t') {
break;
}
indent += char;
}
return trimmedStr.replace(RegExp('^' + indent, 'mg'), ''); // remove indent
}

41
node_modules/graphql/jsutils/dedent.js.flow generated vendored Normal file
View File

@@ -0,0 +1,41 @@
// @flow strict
/**
* An ES6 string tag that fixes indentation. Also removes leading newlines
* and trailing spaces and tabs, but keeps trailing newlines.
*
* Example usage:
* const str = dedent`
* {
* test
* }
* `;
* str === "{\n test\n}\n";
*/
export default function dedent(
strings: $ReadOnlyArray<string>,
...values: $ReadOnlyArray<string>
): string {
let str = '';
for (let i = 0; i < strings.length; ++i) {
str += strings[i];
if (i < values.length) {
str += values[i]; // interpolation
}
}
const trimmedStr = str
.replace(/^\n*/m, '') // remove leading newline
.replace(/[ \t]*$/, ''); // remove trailing spaces and tabs
// fixes indentation by removing leading spaces and tabs from each line
let indent = '';
for (const char of trimmedStr) {
if (char !== ' ' && char !== '\t') {
break;
}
indent += char;
}
return trimmedStr.replace(RegExp('^' + indent, 'mg'), ''); // remove indent
}

41
node_modules/graphql/jsutils/dedent.mjs generated vendored Normal file
View File

@@ -0,0 +1,41 @@
/**
* An ES6 string tag that fixes indentation. Also removes leading newlines
* and trailing spaces and tabs, but keeps trailing newlines.
*
* Example usage:
* const str = dedent`
* {
* test
* }
* `;
* str === "{\n test\n}\n";
*/
export default function dedent(strings) {
var str = '';
for (var i = 0; i < strings.length; ++i) {
str += strings[i];
if (i < (arguments.length <= 1 ? 0 : arguments.length - 1)) {
str += i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1]; // interpolation
}
}
var trimmedStr = str.replace(/^\n*/m, '') // remove leading newline
.replace(/[ \t]*$/, ''); // remove trailing spaces and tabs
// fixes indentation by removing leading spaces and tabs from each line
var indent = '';
for (var _i2 = 0; _i2 < trimmedStr.length; _i2++) {
var char = trimmedStr[_i2];
if (char !== ' ' && char !== '\t') {
break;
}
indent += char;
}
return trimmedStr.replace(RegExp('^' + indent, 'mg'), ''); // remove indent
}

24
node_modules/graphql/jsutils/defineToJSON.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = defineToJSON;
var _nodejsCustomInspectSymbol = _interopRequireDefault(require("./nodejsCustomInspectSymbol"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* The `defineToJSON()` function defines toJSON() and inspect() prototype
* methods, if no function provided they become aliases for toString().
*/
function defineToJSON(classObject) {
var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : classObject.prototype.toString;
classObject.prototype.toJSON = fn;
classObject.prototype.inspect = fn;
if (_nodejsCustomInspectSymbol.default) {
classObject.prototype[_nodejsCustomInspectSymbol.default] = fn;
}
}

18
node_modules/graphql/jsutils/defineToJSON.js.flow generated vendored Normal file
View File

@@ -0,0 +1,18 @@
// @flow strict
import nodejsCustomInspectSymbol from './nodejsCustomInspectSymbol';
/**
* The `defineToJSON()` function defines toJSON() and inspect() prototype
* methods, if no function provided they become aliases for toString().
*/
export default function defineToJSON(
classObject: Class<any> | ((...args: Array<any>) => mixed),
fn?: () => mixed = classObject.prototype.toString,
): void {
classObject.prototype.toJSON = fn;
classObject.prototype.inspect = fn;
if (nodejsCustomInspectSymbol) {
classObject.prototype[nodejsCustomInspectSymbol] = fn;
}
}

15
node_modules/graphql/jsutils/defineToJSON.mjs generated vendored Normal file
View File

@@ -0,0 +1,15 @@
import nodejsCustomInspectSymbol from './nodejsCustomInspectSymbol';
/**
* The `defineToJSON()` function defines toJSON() and inspect() prototype
* methods, if no function provided they become aliases for toString().
*/
export default function defineToJSON(classObject) {
var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : classObject.prototype.toString;
classObject.prototype.toJSON = fn;
classObject.prototype.inspect = fn;
if (nodejsCustomInspectSymbol) {
classObject.prototype[nodejsCustomInspectSymbol] = fn;
}
}

29
node_modules/graphql/jsutils/defineToStringTag.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = defineToStringTag;
/**
* The `defineToStringTag()` function checks first to see if the runtime
* supports the `Symbol` class and then if the `Symbol.toStringTag` constant
* is defined as a `Symbol` instance. If both conditions are met, the
* Symbol.toStringTag property is defined as a getter that returns the
* supplied class constructor's name.
*
* @method defineToStringTag
*
* @param {Class<any>} classObject a class such as Object, String, Number but
* typically one of your own creation through the class keyword; `class A {}`,
* for example.
*/
function defineToStringTag(classObject) {
if (typeof Symbol === 'function' && Symbol.toStringTag) {
Object.defineProperty(classObject.prototype, Symbol.toStringTag, {
get: function get() {
return this.constructor.name;
}
});
}
}

24
node_modules/graphql/jsutils/defineToStringTag.js.flow generated vendored Normal file
View File

@@ -0,0 +1,24 @@
// @flow strict
/**
* The `defineToStringTag()` function checks first to see if the runtime
* supports the `Symbol` class and then if the `Symbol.toStringTag` constant
* is defined as a `Symbol` instance. If both conditions are met, the
* Symbol.toStringTag property is defined as a getter that returns the
* supplied class constructor's name.
*
* @method defineToStringTag
*
* @param {Class<any>} classObject a class such as Object, String, Number but
* typically one of your own creation through the class keyword; `class A {}`,
* for example.
*/
export default function defineToStringTag(classObject: Class<mixed>): void {
if (typeof Symbol === 'function' && Symbol.toStringTag) {
Object.defineProperty(classObject.prototype, Symbol.toStringTag, {
get() {
return this.constructor.name;
},
});
}
}

22
node_modules/graphql/jsutils/defineToStringTag.mjs generated vendored Normal file
View File

@@ -0,0 +1,22 @@
/**
* The `defineToStringTag()` function checks first to see if the runtime
* supports the `Symbol` class and then if the `Symbol.toStringTag` constant
* is defined as a `Symbol` instance. If both conditions are met, the
* Symbol.toStringTag property is defined as a getter that returns the
* supplied class constructor's name.
*
* @method defineToStringTag
*
* @param {Class<any>} classObject a class such as Object, String, Number but
* typically one of your own creation through the class keyword; `class A {}`,
* for example.
*/
export default function defineToStringTag(classObject) {
if (typeof Symbol === 'function' && Symbol.toStringTag) {
Object.defineProperty(classObject.prototype, Symbol.toStringTag, {
get: function get() {
return this.constructor.name;
}
});
}
}

14
node_modules/graphql/jsutils/devAssert.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = devAssert;
function devAssert(condition, message) {
var booleanCondition = Boolean(condition);
if (!booleanCondition) {
throw new Error(message);
}
}

8
node_modules/graphql/jsutils/devAssert.js.flow generated vendored Normal file
View File

@@ -0,0 +1,8 @@
// @flow strict
export default function devAssert(condition: mixed, message: string): void {
const booleanCondition = Boolean(condition);
if (!booleanCondition) {
throw new Error(message);
}
}

7
node_modules/graphql/jsutils/devAssert.mjs generated vendored Normal file
View File

@@ -0,0 +1,7 @@
export default function devAssert(condition, message) {
var booleanCondition = Boolean(condition);
if (!booleanCondition) {
throw new Error(message);
}
}

38
node_modules/graphql/jsutils/didYouMean.js generated vendored Normal file
View File

@@ -0,0 +1,38 @@
"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],
suggestions = _ref[1];
var message = ' Did you mean ';
if (subMessage) {
message += subMessage + ' ';
}
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 + '?';
}

39
node_modules/graphql/jsutils/didYouMean.js.flow generated vendored Normal file
View File

@@ -0,0 +1,39 @@
// @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, suggestions] =
typeof firstArg === 'string'
? [firstArg, secondArg]
: [undefined, firstArg];
let message = ' Did you mean ';
if (subMessage) {
message += subMessage + ' ';
}
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 + '?';
}

32
node_modules/graphql/jsutils/didYouMean.mjs generated vendored Normal file
View File

@@ -0,0 +1,32 @@
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],
suggestions = _ref[1];
var message = ' Did you mean ';
if (subMessage) {
message += subMessage + ' ';
}
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 + '?';
}

13
node_modules/graphql/jsutils/identityFunc.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = identityFunc;
/**
* Returns the first argument it receives.
*/
function identityFunc(x) {
return x;
}

8
node_modules/graphql/jsutils/identityFunc.js.flow generated vendored Normal file
View File

@@ -0,0 +1,8 @@
// @flow strict
/**
* Returns the first argument it receives.
*/
export default function identityFunc<T>(x: T): T {
return x;
}

6
node_modules/graphql/jsutils/identityFunc.mjs generated vendored Normal file
View File

@@ -0,0 +1,6 @@
/**
* Returns the first argument it receives.
*/
export default function identityFunc(x) {
return x;
}

134
node_modules/graphql/jsutils/inspect.js generated vendored Normal file
View File

@@ -0,0 +1,134 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = inspect;
var _nodejsCustomInspectSymbol = _interopRequireDefault(require("./nodejsCustomInspectSymbol"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _typeof(obj) { 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) {
// $FlowFixMe(>=0.90.0)
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;
}

126
node_modules/graphql/jsutils/inspect.js.flow generated vendored Normal file
View File

@@ -0,0 +1,126 @@
// @flow strict
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, seenValues) {
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, previouslySeenValues) {
if (previouslySeenValues.indexOf(value) !== -1) {
return '[Circular]';
}
const seenValues = [...previouslySeenValues, value];
const customInspectFn = getCustomFn(value);
if (customInspectFn !== undefined) {
// $FlowFixMe(>=0.90.0)
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, seenValues) {
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, seenValues) {
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) {
const customInspectFn = object[String(nodejsCustomInspectSymbol)];
if (typeof customInspectFn === 'function') {
return customInspectFn;
}
if (typeof object.inspect === 'function') {
return object.inspect;
}
}
function getObjectTag(object) {
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;
}

124
node_modules/graphql/jsutils/inspect.mjs generated vendored Normal file
View File

@@ -0,0 +1,124 @@
function _typeof(obj) { 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 nodejsCustomInspectSymbol from './nodejsCustomInspectSymbol';
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) {
// $FlowFixMe(>=0.90.0)
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;
}

35
node_modules/graphql/jsutils/instanceOf.js generated vendored Normal file
View File

@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* 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/
var _default = process.env.NODE_ENV === 'production' ? // 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 (value) {
var valueClass = value.constructor;
var className = constructor.name;
if (className && valueClass && valueClass.name === className) {
throw new Error("Cannot use ".concat(className, " \"").concat(value, "\" 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;

45
node_modules/graphql/jsutils/instanceOf.js.flow generated vendored Normal file
View File

@@ -0,0 +1,45 @@
// @flow strict
/**
* 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'
? // eslint-disable-next-line no-shadow
function instanceOf(value: mixed, constructor: mixed) {
return value instanceof constructor;
}
: // eslint-disable-next-line no-shadow
function instanceOf(value: any, constructor: any) {
if (value instanceof constructor) {
return true;
}
if (value) {
const valueClass = value.constructor;
const className = constructor.name;
if (className && valueClass && valueClass.name === className) {
throw new Error(
`Cannot use ${className} "${value}" 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;
};

26
node_modules/graphql/jsutils/instanceOf.mjs generated vendored Normal file
View File

@@ -0,0 +1,26 @@
/**
* 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' ? // 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 (value) {
var valueClass = value.constructor;
var className = constructor.name;
if (className && valueClass && valueClass.name === className) {
throw new Error("Cannot use ".concat(className, " \"").concat(value, "\" 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;
};

14
node_modules/graphql/jsutils/invariant.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = invariant;
function invariant(condition, message) {
var booleanCondition = Boolean(condition);
if (!booleanCondition) {
throw new Error(message || 'Unexpected invariant triggered');
}
}

8
node_modules/graphql/jsutils/invariant.js.flow generated vendored Normal file
View File

@@ -0,0 +1,8 @@
// @flow strict
export default function invariant(condition: mixed, message?: string): void {
const booleanCondition = Boolean(condition);
if (!booleanCondition) {
throw new Error(message || 'Unexpected invariant triggered');
}
}

7
node_modules/graphql/jsutils/invariant.mjs generated vendored Normal file
View File

@@ -0,0 +1,7 @@
export default function invariant(condition, message) {
var booleanCondition = Boolean(condition);
if (!booleanCondition) {
throw new Error(message || 'Unexpected invariant triggered');
}
}

13
node_modules/graphql/jsutils/isInvalid.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isInvalid;
/**
* Returns true if a value is undefined, or NaN.
*/
function isInvalid(value) {
return value === undefined || value !== value;
}

8
node_modules/graphql/jsutils/isInvalid.js.flow generated vendored Normal file
View File

@@ -0,0 +1,8 @@
// @flow strict
/**
* Returns true if a value is undefined, or NaN.
*/
export default function isInvalid(value: mixed): boolean %checks {
return value === undefined || value !== value;
}

6
node_modules/graphql/jsutils/isInvalid.mjs generated vendored Normal file
View File

@@ -0,0 +1,6 @@
/**
* Returns true if a value is undefined, or NaN.
*/
export default function isInvalid(value) {
return value === undefined || value !== value;
}

13
node_modules/graphql/jsutils/isNullish.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isNullish;
/**
* Returns true if a value is null, undefined, or NaN.
*/
function isNullish(value) {
return value === null || value === undefined || value !== value;
}

8
node_modules/graphql/jsutils/isNullish.js.flow generated vendored Normal file
View File

@@ -0,0 +1,8 @@
// @flow strict
/**
* Returns true if a value is null, undefined, or NaN.
*/
export default function isNullish(value: mixed): boolean %checks {
return value === null || value === undefined || value !== value;
}

6
node_modules/graphql/jsutils/isNullish.mjs generated vendored Normal file
View File

@@ -0,0 +1,6 @@
/**
* Returns true if a value is null, undefined, or NaN.
*/
export default function isNullish(value) {
return value === null || value === undefined || value !== value;
}

16
node_modules/graphql/jsutils/isObjectLike.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isObjectLike;
function _typeof(obj) { 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;
}

9
node_modules/graphql/jsutils/isObjectLike.js.flow generated vendored Normal file
View File

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

9
node_modules/graphql/jsutils/isObjectLike.mjs generated vendored Normal file
View File

@@ -0,0 +1,9 @@
function _typeof(obj) { 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;
}

15
node_modules/graphql/jsutils/isPromise.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
"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 Boolean(value && typeof value.then === 'function');
}

13
node_modules/graphql/jsutils/isPromise.js.flow generated vendored Normal file
View File

@@ -0,0 +1,13 @@
// @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 Boolean(value && typeof value.then === 'function');
}

8
node_modules/graphql/jsutils/isPromise.mjs generated vendored Normal file
View File

@@ -0,0 +1,8 @@
/**
* 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 Boolean(value && typeof value.then === 'function');
}

36
node_modules/graphql/jsutils/keyMap.js generated vendored Normal file
View File

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

36
node_modules/graphql/jsutils/keyMap.js.flow generated vendored Normal file
View File

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

29
node_modules/graphql/jsutils/keyMap.mjs generated vendored Normal file
View File

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

30
node_modules/graphql/jsutils/keyValMap.js generated vendored Normal file
View File

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

31
node_modules/graphql/jsutils/keyValMap.js.flow generated vendored Normal file
View File

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

23
node_modules/graphql/jsutils/keyValMap.mjs generated vendored Normal file
View File

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

27
node_modules/graphql/jsutils/mapValue.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = mapValue;
var _objectEntries3 = _interopRequireDefault(require("../polyfills/objectEntries"));
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;
}

21
node_modules/graphql/jsutils/mapValue.js.flow generated vendored Normal file
View File

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

18
node_modules/graphql/jsutils/mapValue.mjs generated vendored Normal file
View File

@@ -0,0 +1,18 @@
import objectEntries from '../polyfills/objectEntries';
/**
* 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;
}

48
node_modules/graphql/jsutils/memoize3.js generated vendored Normal file
View File

@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = memoize3;
/**
* Memoizes the provided three-argument function.
*/
function memoize3(fn) {
var cache0;
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;
}
return memoized;
}

42
node_modules/graphql/jsutils/memoize3.js.flow generated vendored Normal file
View File

@@ -0,0 +1,42 @@
// @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;
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;
}
return memoized;
}

41
node_modules/graphql/jsutils/memoize3.mjs generated vendored Normal file
View File

@@ -0,0 +1,41 @@
/**
* Memoizes the provided three-argument function.
*/
export default function memoize3(fn) {
var cache0;
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;
}
return memoized;
}

View File

@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined;
var _default = nodejsCustomInspectSymbol;
exports.default = _default;

View File

@@ -0,0 +1,8 @@
// @flow strict
const nodejsCustomInspectSymbol =
typeof Symbol === 'function' && typeof Symbol.for === 'function'
? Symbol.for('nodejs.util.inspect.custom')
: undefined;
export default nodejsCustomInspectSymbol;

View File

@@ -0,0 +1,2 @@
var nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined;
export default nodejsCustomInspectSymbol;

15
node_modules/graphql/jsutils/printPathArray.js generated vendored Normal file
View File

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

14
node_modules/graphql/jsutils/printPathArray.js.flow generated vendored Normal file
View File

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

8
node_modules/graphql/jsutils/printPathArray.mjs generated vendored Normal file
View File

@@ -0,0 +1,8 @@
/**
* Build a string describing the path.
*/
export default function printPathArray(path) {
return path.map(function (key) {
return typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key;
}).join('');
}

26
node_modules/graphql/jsutils/promiseForObject.js generated vendored Normal file
View File

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

23
node_modules/graphql/jsutils/promiseForObject.js.flow generated vendored Normal file
View File

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

19
node_modules/graphql/jsutils/promiseForObject.mjs generated vendored Normal file
View File

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

25
node_modules/graphql/jsutils/promiseReduce.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = promiseReduce;
var _isPromise = _interopRequireDefault(require("./isPromise"));
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);
}

25
node_modules/graphql/jsutils/promiseReduce.js.flow generated vendored Normal file
View File

@@ -0,0 +1,25 @@
// @flow strict
import isPromise from './isPromise';
import { type PromiseOrValue } from './PromiseOrValue';
/**
* 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,
);
}

16
node_modules/graphql/jsutils/promiseReduce.mjs generated vendored Normal file
View File

@@ -0,0 +1,16 @@
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(values, callback, initialValue) {
return values.reduce(function (previous, value) {
return isPromise(previous) ? previous.then(function (resolved) {
return callback(resolved, value);
}) : callback(previous, value);
}, initialValue);
}

85
node_modules/graphql/jsutils/suggestionList.js generated vendored Normal file
View File

@@ -0,0 +1,85 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = suggestionList;
/**
* 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 inputThreshold = input.length / 2;
for (var _i2 = 0; _i2 < options.length; _i2++) {
var option = options[_i2];
var distance = lexicalDistance(input, option);
var threshold = Math.max(inputThreshold, option.length / 2, 1);
if (distance <= threshold) {
optionsByDistance[option] = distance;
}
}
return Object.keys(optionsByDistance).sort(function (a, b) {
return optionsByDistance[a] - optionsByDistance[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
*
* @param {string} a
* @param {string} b
* @return {int} distance in number of edits
*/
function lexicalDistance(aStr, bStr) {
if (aStr === bStr) {
return 0;
}
var d = [];
var a = aStr.toLowerCase();
var b = bStr.toLowerCase();
var aLength = a.length;
var bLength = b.length; // Any case change counts as a single edit
if (a === b) {
return 1;
}
for (var i = 0; i <= aLength; i++) {
d[i] = [i];
}
for (var j = 1; j <= bLength; j++) {
d[0][j] = j;
}
for (var _i3 = 1; _i3 <= aLength; _i3++) {
for (var _j = 1; _j <= bLength; _j++) {
var cost = a[_i3 - 1] === b[_j - 1] ? 0 : 1;
d[_i3][_j] = Math.min(d[_i3 - 1][_j] + 1, d[_i3][_j - 1] + 1, d[_i3 - 1][_j - 1] + cost);
if (_i3 > 1 && _j > 1 && a[_i3 - 1] === b[_j - 2] && a[_i3 - 2] === b[_j - 1]) {
d[_i3][_j] = Math.min(d[_i3][_j], d[_i3 - 2][_j - 2] + cost);
}
}
}
return d[aLength][bLength];
}

84
node_modules/graphql/jsutils/suggestionList.js.flow generated vendored Normal file
View File

@@ -0,0 +1,84 @@
// @flow strict
/**
* 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 inputThreshold = input.length / 2;
for (const option of options) {
const distance = lexicalDistance(input, option);
const threshold = Math.max(inputThreshold, option.length / 2, 1);
if (distance <= threshold) {
optionsByDistance[option] = distance;
}
}
return Object.keys(optionsByDistance).sort(
(a, b) => optionsByDistance[a] - optionsByDistance[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
*
* @param {string} a
* @param {string} b
* @return {int} distance in number of edits
*/
function lexicalDistance(aStr, bStr) {
if (aStr === bStr) {
return 0;
}
const d = [];
const a = aStr.toLowerCase();
const b = bStr.toLowerCase();
const aLength = a.length;
const bLength = b.length;
// Any case change counts as a single edit
if (a === b) {
return 1;
}
for (let i = 0; i <= aLength; i++) {
d[i] = [i];
}
for (let j = 1; j <= bLength; j++) {
d[0][j] = j;
}
for (let i = 1; i <= aLength; i++) {
for (let j = 1; j <= bLength; j++) {
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
d[i][j] = Math.min(
d[i - 1][j] + 1,
d[i][j - 1] + 1,
d[i - 1][j - 1] + cost,
);
if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + cost);
}
}
}
return d[aLength][bLength];
}

77
node_modules/graphql/jsutils/suggestionList.mjs generated vendored Normal file
View File

@@ -0,0 +1,77 @@
/**
* 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 inputThreshold = input.length / 2;
for (var _i2 = 0; _i2 < options.length; _i2++) {
var option = options[_i2];
var distance = lexicalDistance(input, option);
var threshold = Math.max(inputThreshold, option.length / 2, 1);
if (distance <= threshold) {
optionsByDistance[option] = distance;
}
}
return Object.keys(optionsByDistance).sort(function (a, b) {
return optionsByDistance[a] - optionsByDistance[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
*
* @param {string} a
* @param {string} b
* @return {int} distance in number of edits
*/
function lexicalDistance(aStr, bStr) {
if (aStr === bStr) {
return 0;
}
var d = [];
var a = aStr.toLowerCase();
var b = bStr.toLowerCase();
var aLength = a.length;
var bLength = b.length; // Any case change counts as a single edit
if (a === b) {
return 1;
}
for (var i = 0; i <= aLength; i++) {
d[i] = [i];
}
for (var j = 1; j <= bLength; j++) {
d[0][j] = j;
}
for (var _i3 = 1; _i3 <= aLength; _i3++) {
for (var _j = 1; _j <= bLength; _j++) {
var cost = a[_i3 - 1] === b[_j - 1] ? 0 : 1;
d[_i3][_j] = Math.min(d[_i3 - 1][_j] + 1, d[_i3][_j - 1] + 1, d[_i3 - 1][_j - 1] + cost);
if (_i3 > 1 && _j > 1 && a[_i3 - 1] === b[_j - 2] && a[_i3 - 2] === b[_j - 1]) {
d[_i3][_j] = Math.min(d[_i3][_j], d[_i3 - 2][_j - 2] + cost);
}
}
}
return d[aLength][bLength];
}

28
node_modules/graphql/jsutils/toObjMap.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = toObjMap;
var _objectEntries3 = _interopRequireDefault(require("../polyfills/objectEntries"));
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;
}

26
node_modules/graphql/jsutils/toObjMap.js.flow generated vendored Normal file
View File

@@ -0,0 +1,26 @@
// @flow strict
import objectEntries from '../polyfills/objectEntries';
import {
type ObjMap,
type ObjMapLike,
type ReadOnlyObjMap,
type 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;
}

18
node_modules/graphql/jsutils/toObjMap.mjs generated vendored Normal file
View File

@@ -0,0 +1,18 @@
import objectEntries from '../polyfills/objectEntries';
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;
}