Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gql.tada/internal

Package Overview
Dependencies
Maintainers
1
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gql.tada/internal - npm Package Compare versions

Comparing version 0.1.0-canary-0c7178c3869822f586e7b12fa5821ebbe662c993 to 0.1.0-canary-3b1ef6d54e33b53835e16ccdbe85d5d99add2178

4

CHANGELOG.md
# @gql.tada/internal
## 0.1.0-canary-0c7178c3869822f586e7b12fa5821ebbe662c993
## 0.1.0-canary-3b1ef6d54e33b53835e16ccdbe85d5d99add2178
### Minor Changes
- Expose introspection output format generation from `@gql.tada/internal` and implement a new pre-processed output format, which pre-computes the output of the `mapIntrospection` type
Submitted by [@kitten](https://github.com/kitten) (See [#150](https://github.com/0no-co/gql.tada/pull/150))
- Add `@gql.tada/internal` package to extract common logic between the CLI and the LSP
Submitted by [@JoviDeCroock](https://github.com/JoviDeCroock) (See [#149](https://github.com/0no-co/gql.tada/pull/149))

@@ -0,1 +1,50 @@

import * as typescript from 'typescript';
import { CompilerHost, ScriptTarget, CreateSourceFileOptions, ResolvedModule } from 'typescript';
/*!@ts-ignore*/
import { IntrospectionQuery } from 'graphql';
declare function normalize(filename: string): string;
/** @internal */
declare function importModule(host: CompilerHost, id: string): Promise<void>;
/** @internal */
declare function importLib(host: CompilerHost): Promise<void>;
/** @internal */
declare function resolveModuleFile(from: string): Promise<string>;
/** @internal */
type VirtualCompilerHost = ReturnType<typeof createVirtualHost> & CompilerHost;
/** @internal */
declare const createProgram: (rootNames: string[], host: CompilerHost) => typescript.Program;
/** @internal */
declare function createVirtualHost(): {
getCanonicalFileName: typeof normalize;
getDefaultLibFileName(): string;
getCurrentDirectory(): '/' | '\\';
getNewLine(): string;
getModuleResolutionCache(): typescript.ModuleResolutionCache;
useCaseSensitiveFileNames(): true;
fileExists(filename: string): boolean;
directoryExists(directoryName: string): boolean;
writeFile(filename: string, content: Uint8Array | string): void;
getDirectories(directoryName: string): string[];
readFile(filename: string): string | undefined;
getSourceFile(
filename: string,
languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions
): typescript.SourceFile | undefined;
resolveModuleNames(moduleNames: string[], containingFile: string): (ResolvedModule | undefined)[];
};
declare function minifyIntrospection(introspection: IntrospectionQuery): IntrospectionQuery;
declare function preprocessIntrospection({ __schema: schema }: IntrospectionQuery): Promise<string>;
interface OutputIntrospectionFileOptions {
fileType: '.ts' | '.d.ts' | string;
shouldPreprocess?: boolean;
}
declare function outputIntrospectionFile(
introspection: IntrospectionQuery | string,
opts: OutputIntrospectionFileOptions
): Promise<string>;
declare const resolveTypeScriptRootDir: (

@@ -6,2 +55,13 @@ readFile: (path: string) => string | undefined,

export { resolveTypeScriptRootDir };
export {
type VirtualCompilerHost,
createProgram,
createVirtualHost,
importLib,
importModule,
minifyIntrospection,
outputIntrospectionFile,
preprocessIntrospection,
resolveModuleFile,
resolveTypeScriptRootDir,
};

@@ -5,4 +5,464 @@ Object.defineProperty(exports, "__esModule", {

var u = require("path");
var u = require("typescript");
var e = require("node:path");
var r = require("node:fs/promises");
var t = require("node:module");
var D = require("path");
var a = "undefined" != typeof document ? document.currentScript : null;
var n = {
rootDir: "/",
moduleResolution: u.ModuleResolutionKind.Bundler,
skipLibCheck: !0,
skipDefaultLibCheck: !0,
allowImportingTsExtensions: !0,
allowSyntheticDefaultImports: !0,
resolvePackageJsonExports: !0,
resolvePackageJsonImports: !0,
resolveJsonModule: !0,
esModuleInterop: !0,
jsx: u.JsxEmit.Preserve,
target: u.ScriptTarget.Latest,
checkJs: !1,
allowJs: !0,
strict: !0,
noEmit: !0,
noLib: !1,
disableReferencedProjectLoad: !0,
disableSourceOfProjectReferenceRedirect: !0,
disableSizeLimit: !0,
disableSolutionSearching: !0
};
class File {
constructor(e, r) {
this.cache = function createTargetCache() {
return {
[u.ScriptTarget[u.ScriptTarget.ES3]]: null,
[u.ScriptTarget[u.ScriptTarget.ES5]]: null,
[u.ScriptTarget[u.ScriptTarget.ES2015]]: null,
[u.ScriptTarget[u.ScriptTarget.ES2016]]: null,
[u.ScriptTarget[u.ScriptTarget.ES2017]]: null,
[u.ScriptTarget[u.ScriptTarget.ES2018]]: null,
[u.ScriptTarget[u.ScriptTarget.ES2019]]: null,
[u.ScriptTarget[u.ScriptTarget.ES2020]]: null,
[u.ScriptTarget[u.ScriptTarget.ES2021]]: null,
[u.ScriptTarget[u.ScriptTarget.ES2022]]: null,
[u.ScriptTarget[u.ScriptTarget.Latest]]: null,
[u.ScriptTarget[u.ScriptTarget.JSON]]: null
};
}();
this.name = normalize(e);
if ("string" == typeof r) {
this.text = r || "\n";
this.data = null;
} else {
this.text = null;
this.data = r;
}
}
toSourceFile(e) {
var r = "object" == typeof e ? e.languageVersion : e;
return function getTargetCache(e, r) {
return e[u.ScriptTarget[r]] || null;
}(this.cache, r) || function setTargetCache(e, r, t) {
e[u.ScriptTarget[r]] = t;
return t;
}(this.cache, r, u.createSourceFile(this.name, this.toString(), e));
}
toBuffer() {
return this.data || (this.data = (new TextEncoder).encode(this.text));
}
toString() {
return this.text || (this.text = (new TextDecoder).decode(this.data));
}
}
class Directory {
constructor() {
this.children = Object.create(null);
this.files = Object.create(null);
}
getOrCreateDirectory(u) {
return this.children[u] || (this.children[u] = new Directory);
}
}
function normalize(u) {
return e.posix.normalize(!u.startsWith(e.posix.sep) ? e.posix.sep + u : u);
}
function split(u) {
return u !== e.posix.sep ? u.split(e.posix.sep).slice(1) : [];
}
var i = e.posix.sep;
var o = "function" == typeof require ? require.resolve : t.createRequire("undefined" == typeof document ? require("url").pathToFileURL(__filename).href : a && a.src || new URL("dist/gql-tada-internal.js", document.baseURI).href).resolve;
var toPath = u => u.split(e.sep).join("/");
async function importModule(u, t) {
var D = `${t}/package.json`;
var a = o(D, {
paths: [ "node_modules", ...o.paths(D) || [] ]
});
if (!a) {
throw new Error(`Failed to resolve "${t}"`);
}
var n = e.dirname(a);
var i = `/node_modules/${t}/`;
await async function walk(t) {
for (var D of await r.readdir(t)) {
var a = e.join(t, D);
if ((await r.stat(a)).isDirectory()) {
await walk(a);
} else {
var o = e.join(e.relative(n, t), D);
var s = await r.readFile(a, {
encoding: "utf8"
});
u.writeFile(i + toPath(o), s, !1);
}
}
}(n);
}
async function importLib(u) {
var t = "typescript/package.json";
var D = o(t, {
paths: [ "node_modules", ...o.paths(t) || [] ]
});
if (!D) {
throw new Error("Failed to resolve typescript");
}
var a = e.join(e.dirname(D), "lib");
var i = (await Promise.all([ "lib.es5.d.ts", "lib.es2015.symbol.d.ts", "lib.es2015.collection.d.ts", "lib.es2015.iterable.d.ts" ].map((u => r.readFile(e.resolve(a, u), {
encoding: "utf8"
}))))).join("\n");
u.writeFile(u.getDefaultLibFileName(n), i, !1);
}
async function resolveModuleFile(u) {
var t = u.indexOf("/");
var D = u.slice(0, t);
var a = u.slice(t);
var n = `${D}/package.json`;
var i = o(n, {
paths: [ "node_modules", ...o.paths(n) || [] ]
});
if (!i) {
throw new Error(`Failed to resolve "${D}"`);
}
var s = e.join(e.dirname(i), a);
return r.readFile(s, {
encoding: "utf8"
});
}
var s = "lib.d.ts";
var F = "";
var createProgram = (e, r) => u.createProgram(e, n, r);
function createVirtualHost() {
var e = u.createModuleResolutionCache(i, normalize, n);
var r = new Directory;
r.files[s] = new File(s, F);
return {
getCanonicalFileName: normalize,
getDefaultLibFileName: () => i + s,
getCurrentDirectory: () => i,
getNewLine: () => "\n",
getModuleResolutionCache: () => e,
useCaseSensitiveFileNames: () => !0,
fileExists(u) {
var e = split(normalize(u));
var t = r;
for (var D = 0; D < e.length - 1; D++) {
if (!(t = t.children[e[D]])) {
return !1;
}
}
return !!t.files[e[e.length - 1]];
},
directoryExists(u) {
var e = split(normalize(u));
if (!e.length) {
return !0;
}
var t = r;
for (var D = 0; D < e.length - 1; D++) {
if (!(t = t.children[e[D]])) {
return !1;
}
}
return !!t.children[e[e.length - 1]];
},
writeFile(u, e) {
var t = normalize(u);
var D = split(t);
var a = r;
for (var n = 0; n < D.length - 1; n++) {
a = a.getOrCreateDirectory(D[n]);
}
a.files[D[D.length - 1]] = new File(t, e);
},
getDirectories(u) {
var e = split(normalize(u));
var t = r;
for (var D = 0; D < e.length; D++) {
if (!(t = t.children[e[D]])) {
return [];
}
}
return Object.keys(t.children);
},
readFile(u) {
var e = split(normalize(u));
var t = r;
for (var D = 0; D < e.length - 1; D++) {
if (!(t = t.children[e[D]])) {
return;
}
}
var a = t.files[e[e.length - 1]];
return a && a.toString();
},
getSourceFile(u, e) {
var t = split(normalize(u));
var D = r;
for (var a = 0; a < t.length - 1; a++) {
if (!(D = D.children[t[a]])) {
return;
}
}
var n = D.files[t[t.length - 1]];
return n && n.toSourceFile(e);
},
resolveModuleNames(r, t) {
var D = [];
for (var a of r) {
var i = u.resolveModuleName(a, t, n, this, e);
D.push(i.resolvedModule);
}
return D;
}
};
}
var c = !1;
var C = !1;
var A = !1;
var E = !1;
var l = {
kind: "SCALAR",
name: "Any"
};
var mapType = u => {
switch (u.kind) {
case "NON_NULL":
case "LIST":
return {
kind: u.kind,
ofType: mapType(u.ofType)
};
case "SCALAR":
if (c) {
return u;
} else {
E = !0;
return l;
}
case "INPUT_OBJECT":
if (A) {
return u;
} else {
E = !0;
return l;
}
case "ENUM":
if (C) {
return u;
} else {
E = !0;
return l;
}
case "OBJECT":
case "INTERFACE":
case "UNION":
return u;
default:
throw new TypeError(`Unrecognized type reference of type: ${u.kind}.`);
}
};
var minifyIntrospectionType = u => {
switch (u.kind) {
case "SCALAR":
return {
kind: "SCALAR",
name: u.name
};
case "ENUM":
return {
kind: "ENUM",
name: u.name,
enumValues: u.enumValues.map((u => ({
name: u.name
})))
};
case "INPUT_OBJECT":
return {
kind: "INPUT_OBJECT",
name: u.name,
inputFields: u.inputFields.map((u => ({
name: u.name,
type: mapType(u.type),
defaultValue: u.defaultValue || void 0
})))
};
case "OBJECT":
return {
kind: "OBJECT",
name: u.name,
fields: u.fields.map((u => ({
name: u.name,
type: u.type && mapType(u.type),
args: u.args && u.args.map((u => ({
name: u.name,
type: mapType(u.type)
})))
}))),
interfaces: u.interfaces && u.interfaces.map((u => ({
kind: "INTERFACE",
name: u.name
})))
};
case "INTERFACE":
return {
kind: "INTERFACE",
name: u.name,
fields: u.fields.map((u => ({
name: u.name,
type: u.type && mapType(u.type),
args: u.args && u.args.map((u => ({
name: u.name,
type: mapType(u.type)
})))
}))),
interfaces: u.interfaces && u.interfaces.map((u => ({
kind: "INTERFACE",
name: u.name
}))),
possibleTypes: u.possibleTypes && u.possibleTypes.map((u => ({
kind: u.kind,
name: u.name
})))
};
case "UNION":
return {
kind: "UNION",
name: u.name,
possibleTypes: u.possibleTypes.map((u => ({
kind: u.kind,
name: u.name
})))
};
default:
return u;
}
};
var f = [ "/* eslint-disable */", "/* prettier-ignore */" ].join("\n") + "\n";
var d = [ "/** An IntrospectionQuery representation of your schema.", " *", " * @remarks", " * This is an introspection of your schema saved as a file by GraphQLSP.", " * It will automatically be used by `gql.tada` to infer the types of your GraphQL documents.", " * If you need to reuse this data or update your `scalars`, update `tadaOutputLocation` to", " * instead save to a .ts instead of a .d.ts file.", " */" ].join("\n");
var p = [ "/** An IntrospectionQuery representation of your schema.", " *", " * @remarks", " * This is an introspection of your schema saved as a file by GraphQLSP.", " * You may import it to create a `graphql()` tag function with `gql.tada`", " * by importing it and passing it to `initGraphQLTada<>()`.", " *", " * @example", " * ```", " * import { initGraphQLTada } from 'gql.tada';", " * import type { introspection } from './introspection';", " *", " * export const graphql = initGraphQLTada<{", " * introspection: typeof introspection;", " * scalars: {", " * DateTime: string;", " * Json: any;", " * };", " * }>();", " * ```", " */" ].join("\n");
class TSError extends Error {
constructor(u, e) {
super(u);
this.name = "TSError";
this.diagnostics = e || [];
}
}
class TadaError extends Error {
constructor(u) {
super(u);
this.name = "TadaError";
}
}
var B = "index.ts";
var v = "$__";
var m = u.TypeFormatFlags.NoTruncation | u.TypeFormatFlags.NoTypeReduction | u.TypeFormatFlags.InTypeAlias | u.TypeFormatFlags.UseFullyQualifiedType | u.TypeFormatFlags.GenerateNamesForShadowedTypeParams;
var stringifyJson = u => "string" == typeof u ? u : JSON.stringify(u, null, 2);
var stringifyName = u => u ? JSON.stringify(u) : "never";
async function preprocessIntrospection({__schema: u}) {
var e = stringifyName(u.queryType.name);
var r = stringifyName(u.mutationType && u.mutationType.name);
var t = stringifyName(u.subscriptionType && u.subscriptionType.name);
var D = 'import type { __mapType } from "./gql-tada.ts";\n';
for (var a of u.types) {
D += `export type ${v + a.name} = __mapType<${JSON.stringify(a)}>;\n`;
}
var n = await async function createHost(u) {
var e = createVirtualHost();
await importLib(e);
await importModule(e, "@0no-co/graphql.web");
e.writeFile("gql-tada.ts", await resolveModuleFile("gql.tada/dist/gql-tada.d.ts"));
e.writeFile(B, u);
return e;
}(D);
var i = createProgram([ B ], n);
var o = i.getTypeChecker();
var s = i.getSemanticDiagnostics();
var F = i.getSourceFile(B);
var c = F && o.getSymbolAtLocation(F);
if (s.length || !c) {
throw new TSError("TypeScript failed to evaluate introspection", s);
}
var C = "";
for (var A of o.getExportsOfModule(c)) {
var E = A && A.declarations && A.declarations[0];
var l = E && o.getTypeAtLocation(E);
if (!l) {
throw new TSError("Something went wrong while evaluating introspection type.");
}
var f = o.typeToString(l, void 0, m).trim();
var d = A.name.slice(v.length);
C += ` ${stringifyName(d)}: ${f};\n`;
}
return `{\n query: ${e};\n mutation: ${r};\n subscription: ${t};\n types: {\n${C} };\n}`;
}
function getDefaultExportFromCjs(u) {

@@ -12,24 +472,24 @@ return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;

var D = {
var h = {
exports: {}
};
D.exports = function() {
function createCommonjsModule(u, D) {
return u(D = {
h.exports = function() {
function createCommonjsModule(u, e) {
return u(e = {
exports: {}
}, D.exports), D.exports;
}, e.exports), e.exports;
}
var u = createCommonjsModule((function(u) {
var D = u.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")();
var e = u.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")();
if ("number" == typeof __g) {
__g = D;
__g = e;
}
}));
var D = createCommonjsModule((function(u) {
var D = u.exports = {
var e = createCommonjsModule((function(u) {
var e = u.exports = {
version: "2.6.5"
};
if ("number" == typeof __e) {
__e = D;
__e = e;
}

@@ -53,3 +513,3 @@ }));

};
var e = !_fails((function() {
var r = !_fails((function() {
return 7 != Object.defineProperty({}, "a", {

@@ -61,8 +521,8 @@ get: function() {

}));
var r = u.document;
var n = _isObject(r) && _isObject(r.createElement);
var t = u.document;
var D = _isObject(t) && _isObject(t.createElement);
var _domCreate = function(u) {
return n ? r.createElement(u) : {};
return D ? t.createElement(u) : {};
};
var t = !e && !_fails((function() {
var a = !r && !_fails((function() {
return 7 != Object.defineProperty(_domCreate("div"), "a", {

@@ -74,34 +534,34 @@ get: function() {

}));
var _toPrimitive = function(u, D) {
var _toPrimitive = function(u, e) {
if (!_isObject(u)) {
return u;
}
var e, r;
if (D && "function" == typeof (e = u.toString) && !_isObject(r = e.call(u))) {
return r;
var r, t;
if (e && "function" == typeof (r = u.toString) && !_isObject(t = r.call(u))) {
return t;
}
if ("function" == typeof (e = u.valueOf) && !_isObject(r = e.call(u))) {
return r;
if ("function" == typeof (r = u.valueOf) && !_isObject(t = r.call(u))) {
return t;
}
if (!D && "function" == typeof (e = u.toString) && !_isObject(r = e.call(u))) {
return r;
if (!e && "function" == typeof (r = u.toString) && !_isObject(t = r.call(u))) {
return t;
}
throw TypeError("Can't convert object to primitive value");
};
var a = Object.defineProperty;
var n = Object.defineProperty;
var i = {
f: e ? Object.defineProperty : function defineProperty(u, D, e) {
f: r ? Object.defineProperty : function defineProperty(u, e, r) {
_anObject(u);
D = _toPrimitive(D, !0);
_anObject(e);
if (t) {
e = _toPrimitive(e, !0);
_anObject(r);
if (a) {
try {
return a(u, D, e);
return n(u, e, r);
} catch (u) {}
}
if ("get" in e || "set" in e) {
if ("get" in r || "set" in r) {
throw TypeError("Accessors not supported!");
}
if ("value" in e) {
u[D] = e.value;
if ("value" in r) {
u[e] = r.value;
}

@@ -111,3 +571,3 @@ return u;

};
var _propertyDesc = function(u, D) {
var _propertyDesc = function(u, e) {
return {

@@ -117,27 +577,27 @@ enumerable: !(1 & u),

writable: !(4 & u),
value: D
value: e
};
};
var F = e ? function(u, D, e) {
return i.f(u, D, _propertyDesc(1, e));
} : function(u, D, e) {
u[D] = e;
var o = r ? function(u, e, r) {
return i.f(u, e, _propertyDesc(1, r));
} : function(u, e, r) {
u[e] = r;
return u;
};
var C = {}.hasOwnProperty;
var _has = function(u, D) {
return C.call(u, D);
var s = {}.hasOwnProperty;
var _has = function(u, e) {
return s.call(u, e);
};
var A = 0;
var E = Math.random();
var F = 0;
var c = Math.random();
var _uid = function(u) {
return "Symbol(".concat(void 0 === u ? "" : u, ")_", (++A + E).toString(36));
return "Symbol(".concat(void 0 === u ? "" : u, ")_", (++F + c).toString(36));
};
var o = createCommonjsModule((function(e) {
var r = "__core-js_shared__";
var n = u[r] || (u[r] = {});
(e.exports = function(u, D) {
return n[u] || (n[u] = void 0 !== D ? D : {});
var C = createCommonjsModule((function(r) {
var t = "__core-js_shared__";
var D = u[t] || (u[t] = {});
(r.exports = function(u, e) {
return D[u] || (D[u] = void 0 !== e ? e : {});
})("versions", []).push({
version: D.version,
version: e.version,
mode: "global",

@@ -147,33 +607,33 @@ copyright: "© 2019 Denis Pushkarev (zloirock.ru)"

}));
var c = o("native-function-to-string", Function.toString);
var s = createCommonjsModule((function(e) {
var r = _uid("src");
var n = "toString";
var t = ("" + c).split(n);
D.inspectSource = function(u) {
return c.call(u);
var A = C("native-function-to-string", Function.toString);
var E = createCommonjsModule((function(r) {
var t = _uid("src");
var D = "toString";
var a = ("" + A).split(D);
e.inspectSource = function(u) {
return A.call(u);
};
(e.exports = function(D, e, n, a) {
var i = "function" == typeof n;
(r.exports = function(e, r, D, n) {
var i = "function" == typeof D;
if (i) {
_has(n, "name") || F(n, "name", e);
_has(D, "name") || o(D, "name", r);
}
if (D[e] === n) {
if (e[r] === D) {
return;
}
if (i) {
_has(n, r) || F(n, r, D[e] ? "" + D[e] : t.join(String(e)));
_has(D, t) || o(D, t, e[r] ? "" + e[r] : a.join(String(r)));
}
if (D === u) {
D[e] = n;
} else if (!a) {
delete D[e];
F(D, e, n);
} else if (D[e]) {
D[e] = n;
if (e === u) {
e[r] = D;
} else if (!n) {
delete e[r];
o(e, r, D);
} else if (e[r]) {
e[r] = D;
} else {
F(D, e, n);
o(e, r, D);
}
})(Function.prototype, n, (function toString() {
return "function" == typeof this && this[r] || c.call(this);
})(Function.prototype, D, (function toString() {
return "function" == typeof this && this[t] || A.call(this);
}));

@@ -187,55 +647,55 @@ }));

};
var _ctx = function(u, D, e) {
var _ctx = function(u, e, r) {
_aFunction(u);
if (void 0 === D) {
if (void 0 === e) {
return u;
}
switch (e) {
switch (r) {
case 1:
return function(e) {
return u.call(D, e);
return function(r) {
return u.call(e, r);
};
case 2:
return function(e, r) {
return u.call(D, e, r);
return function(r, t) {
return u.call(e, r, t);
};
case 3:
return function(e, r, n) {
return u.call(D, e, r, n);
return function(r, t, D) {
return u.call(e, r, t, D);
};
}
return function() {
return u.apply(D, arguments);
return u.apply(e, arguments);
};
};
var f = "prototype";
var $export = function(e, r, n) {
var t = e & $export.F;
var a = e & $export.G;
var i = e & $export.P;
var C = e & $export.B;
var A = a ? u : e & $export.S ? u[r] || (u[r] = {}) : (u[r] || {})[f];
var E = a ? D : D[r] || (D[r] = {});
var o = E[f] || (E[f] = {});
var c, B, l, d;
if (a) {
n = r;
var l = "prototype";
var $export = function(r, t, D) {
var a = r & $export.F;
var n = r & $export.G;
var i = r & $export.P;
var s = r & $export.B;
var F = n ? u : r & $export.S ? u[t] || (u[t] = {}) : (u[t] || {})[l];
var c = n ? e : e[t] || (e[t] = {});
var C = c[l] || (c[l] = {});
var A, f, d, p;
if (n) {
D = t;
}
for (c in n) {
l = ((B = !t && A && void 0 !== A[c]) ? A : n)[c];
d = C && B ? _ctx(l, u) : i && "function" == typeof l ? _ctx(Function.call, l) : l;
if (A) {
s(A, c, l, e & $export.U);
for (A in D) {
d = ((f = !a && F && void 0 !== F[A]) ? F : D)[A];
p = s && f ? _ctx(d, u) : i && "function" == typeof d ? _ctx(Function.call, d) : d;
if (F) {
E(F, A, d, r & $export.U);
}
if (E[c] != l) {
F(E, c, d);
if (c[A] != d) {
o(c, A, p);
}
if (i && o[c] != l) {
o[c] = l;
if (i && C[A] != d) {
C[A] = d;
}
}
};
u.core = D;
u.core = e;
$export.F = 1;

@@ -249,7 +709,7 @@ $export.G = 2;

$export.R = 128;
var B = $export;
var l = Math.ceil;
var d = Math.floor;
var f = $export;
var d = Math.ceil;
var p = Math.floor;
var _toInteger = function(u) {
return isNaN(u = +u) ? 0 : (u > 0 ? d : l)(u);
return isNaN(u = +u) ? 0 : (u > 0 ? p : d)(u);
};

@@ -262,43 +722,45 @@ var _defined = function(u) {

};
var v = (p = !1, function(u, D) {
var e = String(_defined(u));
var r = _toInteger(D);
var n = e.length;
var t, a;
if (r < 0 || r >= n) {
return p ? "" : void 0;
}
return (t = e.charCodeAt(r)) < 55296 || t > 56319 || r + 1 === n || (a = e.charCodeAt(r + 1)) < 56320 || a > 57343 ? p ? e.charAt(r) : t : p ? e.slice(r, r + 2) : a - 56320 + (t - 55296 << 10) + 65536;
});
var p;
B(B.P, "String", {
var _stringAt = function(u) {
return function(e, r) {
var t = String(_defined(e));
var D = _toInteger(r);
var a = t.length;
var n, i;
if (D < 0 || D >= a) {
return u ? "" : void 0;
}
return (n = t.charCodeAt(D)) < 55296 || n > 56319 || D + 1 === a || (i = t.charCodeAt(D + 1)) < 56320 || i > 57343 ? u ? t.charAt(D) : n : u ? t.slice(D, D + 2) : i - 56320 + (n - 55296 << 10) + 65536;
};
};
var B = _stringAt(!1);
f(f.P, "String", {
codePointAt: function codePointAt(u) {
return v(this, u);
return B(this, u);
}
});
var h = Math.max;
var v = Math.max;
var m = Math.min;
var _toAbsoluteIndex = function(u, D) {
return (u = _toInteger(u)) < 0 ? h(u + D, 0) : m(u, D);
var _toAbsoluteIndex = function(u, e) {
return (u = _toInteger(u)) < 0 ? v(u + e, 0) : m(u, e);
};
var g = String.fromCharCode;
var y = String.fromCodePoint;
B(B.S + B.F * (!!y && 1 != y.length), "String", {
var h = String.fromCharCode;
var g = String.fromCodePoint;
f(f.S + f.F * (!!g && 1 != g.length), "String", {
fromCodePoint: function fromCodePoint(u) {
var D = arguments;
var e = [];
var r = arguments.length;
var n = 0;
var t;
while (r > n) {
t = +D[n++];
if (_toAbsoluteIndex(t, 1114111) !== t) {
throw RangeError(t + " is not a valid code point");
var e = arguments;
var r = [];
var t = arguments.length;
var D = 0;
var a;
while (t > D) {
a = +e[D++];
if (_toAbsoluteIndex(a, 1114111) !== a) {
throw RangeError(a + " is not a valid code point");
}
e.push(t < 65536 ? g(t) : g(55296 + ((t -= 65536) >> 10), t % 1024 + 56320));
r.push(a < 65536 ? h(a) : h(55296 + ((a -= 65536) >> 10), a % 1024 + 56320));
}
return e.join("");
return r.join("");
}
});
var w = {
var y = {
Space_Separator: /[\u1680\u2000-\u200A\u202F\u205F\u3000]/,

@@ -308,11 +770,11 @@ ID_Start: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,

};
var b = {
var w = {
isSpaceSeparator: function isSpaceSeparator(u) {
return "string" == typeof u && w.Space_Separator.test(u);
return "string" == typeof u && y.Space_Separator.test(u);
},
isIdStartChar: function isIdStartChar(u) {
return "string" == typeof u && (u >= "a" && u <= "z" || u >= "A" && u <= "Z" || "$" === u || "_" === u || w.ID_Start.test(u));
return "string" == typeof u && (u >= "a" && u <= "z" || u >= "A" && u <= "Z" || "$" === u || "_" === u || y.ID_Start.test(u));
},
isIdContinueChar: function isIdContinueChar(u) {
return "string" == typeof u && (u >= "a" && u <= "z" || u >= "A" && u <= "Z" || u >= "0" && u <= "9" || "$" === u || "_" === u || "‌" === u || "‍" === u || w.ID_Continue.test(u));
return "string" == typeof u && (u >= "a" && u <= "z" || u >= "A" && u <= "Z" || u >= "0" && u <= "9" || "$" === u || "_" === u || "‌" === u || "‍" === u || y.ID_Continue.test(u));
},

@@ -326,44 +788,44 @@ isDigit: function isDigit(u) {

};
var S;
var T;
var b;
var x;
var S;
var P;
var N;
var k;
var O;
var j;
var T;
var P;
var _;
var I;
var _ = function parse(u, D) {
x = String(u);
S = "start";
P = [];
N = 0;
k = 1;
O = 0;
j = void 0;
T = void 0;
var O = function parse(u, e) {
S = String(u);
T = "start";
b = [];
x = 0;
N = 1;
k = 0;
P = void 0;
_ = void 0;
I = void 0;
do {
j = lex();
$[S]();
} while ("eof" !== j.type);
if ("function" == typeof D) {
P = lex();
J[T]();
} while ("eof" !== P.type);
if ("function" == typeof e) {
return internalize({
"": I
}, "", D);
}, "", e);
}
return I;
};
function internalize(u, D, e) {
var r = u[D];
if (null != r && "object" == typeof r) {
if (Array.isArray(r)) {
for (var n = 0; n < r.length; n++) {
var t = String(n);
var a = internalize(r, t, e);
if (void 0 === a) {
delete r[t];
function internalize(u, e, r) {
var t = u[e];
if (null != t && "object" == typeof t) {
if (Array.isArray(t)) {
for (var D = 0; D < t.length; D++) {
var a = String(D);
var n = internalize(t, a, r);
if (void 0 === n) {
delete t[a];
} else {
Object.defineProperty(r, t, {
value: a,
Object.defineProperty(t, a, {
value: n,
writable: !0,

@@ -376,9 +838,9 @@ enumerable: !0,

} else {
for (var i in r) {
var F = internalize(r, i, e);
if (void 0 === F) {
delete r[i];
for (var i in t) {
var o = internalize(t, i, r);
if (void 0 === o) {
delete t[i];
} else {
Object.defineProperty(r, i, {
value: F,
Object.defineProperty(t, i, {
value: o,
writable: !0,

@@ -392,17 +854,17 @@ enumerable: !0,

}
return e.call(u, D, r);
return r.call(u, e, t);
}
var V;
var z;
var j;
var L;
var M;
var L;
var q;
var V;
function lex() {
V = "default";
z = "";
j = "default";
L = "";
M = !1;
L = 1;
q = 1;
for (;;) {
q = peek();
var u = J[V]();
V = peek();
var u = z[j]();
if (u) {

@@ -414,4 +876,4 @@ return u;

function peek() {
if (x[N]) {
return String.fromCodePoint(x.codePointAt(N));
if (S[x]) {
return String.fromCodePoint(S.codePointAt(x));
}

@@ -422,17 +884,17 @@ }

if ("\n" === u) {
k++;
O = 0;
N++;
k = 0;
} else if (u) {
O += u.length;
k += u.length;
} else {
O++;
k++;
}
if (u) {
N += u.length;
x += u.length;
}
return u;
}
var J = {
var z = {
default: function default$1() {
switch (q) {
switch (V) {
case "\t":

@@ -453,3 +915,3 @@ case "\v":

read();
V = "comment";
j = "comment";
return;

@@ -461,13 +923,13 @@

}
if (b.isSpaceSeparator(q)) {
if (w.isSpaceSeparator(V)) {
read();
return;
}
return J[S]();
return z[T]();
},
comment: function comment() {
switch (q) {
switch (V) {
case "*":
read();
V = "multiLineComment";
j = "multiLineComment";
return;

@@ -477,3 +939,3 @@

read();
V = "singleLineComment";
j = "singleLineComment";
return;

@@ -484,6 +946,6 @@ }

multiLineComment: function multiLineComment() {
switch (q) {
switch (V) {
case "*":
read();
V = "multiLineCommentAsterisk";
j = "multiLineCommentAsterisk";
return;

@@ -497,3 +959,3 @@

multiLineCommentAsterisk: function multiLineCommentAsterisk() {
switch (q) {
switch (V) {
case "*":

@@ -505,3 +967,3 @@ read();

read();
V = "default";
j = "default";
return;

@@ -513,6 +975,6 @@

read();
V = "multiLineComment";
j = "multiLineComment";
},
singleLineComment: function singleLineComment() {
switch (q) {
switch (V) {
case "\n":

@@ -523,3 +985,3 @@ case "\r":

read();
V = "default";
j = "default";
return;

@@ -534,3 +996,3 @@

value: function value() {
switch (q) {
switch (V) {
case "{":

@@ -558,15 +1020,15 @@ case "[":

if ("-" === read()) {
L = -1;
q = -1;
}
V = "sign";
j = "sign";
return;
case ".":
z = read();
V = "decimalPointLeading";
L = read();
j = "decimalPointLeading";
return;
case "0":
z = read();
V = "zero";
L = read();
j = "zero";
return;

@@ -583,4 +1045,4 @@

case "9":
z = read();
V = "decimalInteger";
L = read();
j = "decimalInteger";
return;

@@ -601,4 +1063,4 @@

M = '"' === read();
z = "";
V = "string";
L = "";
j = "string";
return;

@@ -609,3 +1071,3 @@ }

identifierNameStartEscape: function identifierNameStartEscape() {
if ("u" !== q) {
if ("u" !== V) {
throw invalidChar(read());

@@ -621,11 +1083,11 @@ }

default:
if (!b.isIdStartChar(u)) {
if (!w.isIdStartChar(u)) {
throw invalidIdentifier();
}
}
z += u;
V = "identifierName";
L += u;
j = "identifierName";
},
identifierName: function identifierName() {
switch (q) {
switch (V) {
case "$":

@@ -635,3 +1097,3 @@ case "_":

case "‍":
z += read();
L += read();
return;

@@ -641,13 +1103,13 @@

read();
V = "identifierNameEscape";
j = "identifierNameEscape";
return;
}
if (b.isIdContinueChar(q)) {
z += read();
if (w.isIdContinueChar(V)) {
L += read();
return;
}
return newToken("identifier", z);
return newToken("identifier", L);
},
identifierNameEscape: function identifierNameEscape() {
if ("u" !== q) {
if ("u" !== V) {
throw invalidChar(read());

@@ -665,19 +1127,19 @@ }

default:
if (!b.isIdContinueChar(u)) {
if (!w.isIdContinueChar(u)) {
throw invalidIdentifier();
}
}
z += u;
V = "identifierName";
L += u;
j = "identifierName";
},
sign: function sign$1() {
switch (q) {
switch (V) {
case ".":
z = read();
V = "decimalPointLeading";
L = read();
j = "decimalPointLeading";
return;
case "0":
z = read();
V = "zero";
L = read();
j = "zero";
return;

@@ -694,4 +1156,4 @@

case "9":
z = read();
V = "decimalInteger";
L = read();
j = "decimalInteger";
return;

@@ -702,3 +1164,3 @@

literal("nfinity");
return newToken("numeric", L * (1 / 0));
return newToken("numeric", q * (1 / 0));

@@ -713,6 +1175,6 @@ case "N":

zero: function zero() {
switch (q) {
switch (V) {
case ".":
z += read();
V = "decimalPoint";
L += read();
j = "decimalPoint";
return;

@@ -722,4 +1184,4 @@

case "E":
z += read();
V = "decimalExponent";
L += read();
j = "decimalExponent";
return;

@@ -729,13 +1191,13 @@

case "X":
z += read();
V = "hexadecimal";
L += read();
j = "hexadecimal";
return;
}
return newToken("numeric", 0 * L);
return newToken("numeric", 0 * q);
},
decimalInteger: function decimalInteger() {
switch (q) {
switch (V) {
case ".":
z += read();
V = "decimalPoint";
L += read();
j = "decimalPoint";
return;

@@ -745,16 +1207,16 @@

case "E":
z += read();
V = "decimalExponent";
L += read();
j = "decimalExponent";
return;
}
if (b.isDigit(q)) {
z += read();
if (w.isDigit(V)) {
L += read();
return;
}
return newToken("numeric", L * Number(z));
return newToken("numeric", q * Number(L));
},
decimalPointLeading: function decimalPointLeading() {
if (b.isDigit(q)) {
z += read();
V = "decimalFraction";
if (w.isDigit(V)) {
L += read();
j = "decimalFraction";
return;

@@ -765,41 +1227,41 @@ }

decimalPoint: function decimalPoint() {
switch (q) {
switch (V) {
case "e":
case "E":
z += read();
V = "decimalExponent";
L += read();
j = "decimalExponent";
return;
}
if (b.isDigit(q)) {
z += read();
V = "decimalFraction";
if (w.isDigit(V)) {
L += read();
j = "decimalFraction";
return;
}
return newToken("numeric", L * Number(z));
return newToken("numeric", q * Number(L));
},
decimalFraction: function decimalFraction() {
switch (q) {
switch (V) {
case "e":
case "E":
z += read();
V = "decimalExponent";
L += read();
j = "decimalExponent";
return;
}
if (b.isDigit(q)) {
z += read();
if (w.isDigit(V)) {
L += read();
return;
}
return newToken("numeric", L * Number(z));
return newToken("numeric", q * Number(L));
},
decimalExponent: function decimalExponent() {
switch (q) {
switch (V) {
case "+":
case "-":
z += read();
V = "decimalExponentSign";
L += read();
j = "decimalExponentSign";
return;
}
if (b.isDigit(q)) {
z += read();
V = "decimalExponentInteger";
if (w.isDigit(V)) {
L += read();
j = "decimalExponentInteger";
return;

@@ -810,5 +1272,5 @@ }

decimalExponentSign: function decimalExponentSign() {
if (b.isDigit(q)) {
z += read();
V = "decimalExponentInteger";
if (w.isDigit(V)) {
L += read();
j = "decimalExponentInteger";
return;

@@ -819,12 +1281,12 @@ }

decimalExponentInteger: function decimalExponentInteger() {
if (b.isDigit(q)) {
z += read();
if (w.isDigit(V)) {
L += read();
return;
}
return newToken("numeric", L * Number(z));
return newToken("numeric", q * Number(L));
},
hexadecimal: function hexadecimal() {
if (b.isHexDigit(q)) {
z += read();
V = "hexadecimalInteger";
if (w.isHexDigit(V)) {
L += read();
j = "hexadecimalInteger";
return;

@@ -835,13 +1297,13 @@ }

hexadecimalInteger: function hexadecimalInteger() {
if (b.isHexDigit(q)) {
z += read();
if (w.isHexDigit(V)) {
L += read();
return;
}
return newToken("numeric", L * Number(z));
return newToken("numeric", q * Number(L));
},
string: function string() {
switch (q) {
switch (V) {
case "\\":
read();
z += escape();
L += escape();
return;

@@ -852,5 +1314,5 @@

read();
return newToken("string", z);
return newToken("string", L);
}
z += read();
L += read();
return;

@@ -861,5 +1323,5 @@

read();
return newToken("string", z);
return newToken("string", L);
}
z += read();
L += read();
return;

@@ -873,3 +1335,3 @@

case "\u2029":
separatorChar(q);
separatorChar(V);
break;

@@ -880,6 +1342,6 @@

}
z += read();
L += read();
},
start: function start() {
switch (q) {
switch (V) {
case "{":

@@ -889,10 +1351,10 @@ case "[":

}
V = "value";
j = "value";
},
beforePropertyName: function beforePropertyName() {
switch (q) {
switch (V) {
case "$":
case "_":
z = read();
V = "identifierName";
L = read();
j = "identifierName";
return;

@@ -902,3 +1364,3 @@

read();
V = "identifierNameStartEscape";
j = "identifierNameStartEscape";
return;

@@ -912,8 +1374,8 @@

M = '"' === read();
V = "string";
j = "string";
return;
}
if (b.isIdStartChar(q)) {
z += read();
V = "identifierName";
if (w.isIdStartChar(V)) {
L += read();
j = "identifierName";
return;

@@ -924,3 +1386,3 @@ }

afterPropertyName: function afterPropertyName() {
if (":" === q) {
if (":" === V) {
return newToken("punctuator", read());

@@ -931,6 +1393,6 @@ }

beforePropertyValue: function beforePropertyValue() {
V = "value";
j = "value";
},
afterPropertyValue: function afterPropertyValue() {
switch (q) {
switch (V) {
case ",":

@@ -943,9 +1405,9 @@ case "}":

beforeArrayValue: function beforeArrayValue() {
if ("]" === q) {
if ("]" === V) {
return newToken("punctuator", read());
}
V = "value";
j = "value";
},
afterArrayValue: function afterArrayValue() {
switch (q) {
switch (V) {
case ",":

@@ -961,14 +1423,14 @@ case "]":

};
function newToken(u, D) {
function newToken(u, e) {
return {
type: u,
value: D,
line: k,
column: O
value: e,
line: N,
column: k
};
}
function literal(u) {
for (var D = 0, e = u; D < e.length; D += 1) {
var r = e[D];
if (peek() !== r) {
for (var e = 0, r = u; e < r.length; e += 1) {
var t = r[e];
if (peek() !== t) {
throw invalidChar(read());

@@ -1007,3 +1469,3 @@ }

read();
if (b.isDigit(peek())) {
if (w.isDigit(peek())) {
throw invalidChar(read());

@@ -1050,9 +1512,9 @@ }

var u = "";
var D = peek();
if (!b.isHexDigit(D)) {
var e = peek();
if (!w.isHexDigit(e)) {
throw invalidChar(read());
}
u += read();
D = peek();
if (!b.isHexDigit(D)) {
e = peek();
if (!w.isHexDigit(e)) {
throw invalidChar(read());

@@ -1065,6 +1527,6 @@ }

var u = "";
var D = 4;
while (D-- > 0) {
var e = peek();
if (!b.isHexDigit(e)) {
var e = 4;
while (e-- > 0) {
var r = peek();
if (!w.isHexDigit(r)) {
throw invalidChar(read());

@@ -1076,5 +1538,5 @@ }

}
var $ = {
var J = {
start: function start() {
if ("eof" === j.type) {
if ("eof" === P.type) {
throw invalidEOF();

@@ -1085,7 +1547,7 @@ }

beforePropertyName: function beforePropertyName() {
switch (j.type) {
switch (P.type) {
case "identifier":
case "string":
T = j.value;
S = "afterPropertyName";
_ = P.value;
T = "afterPropertyName";
return;

@@ -1102,9 +1564,9 @@

afterPropertyName: function afterPropertyName() {
if ("eof" === j.type) {
if ("eof" === P.type) {
throw invalidEOF();
}
S = "beforePropertyValue";
T = "beforePropertyValue";
},
beforePropertyValue: function beforePropertyValue() {
if ("eof" === j.type) {
if ("eof" === P.type) {
throw invalidEOF();

@@ -1115,6 +1577,6 @@ }

beforeArrayValue: function beforeArrayValue() {
if ("eof" === j.type) {
if ("eof" === P.type) {
throw invalidEOF();
}
if ("punctuator" === j.type && "]" === j.value) {
if ("punctuator" === P.type && "]" === P.value) {
pop();

@@ -1126,8 +1588,8 @@ return;

afterPropertyValue: function afterPropertyValue() {
if ("eof" === j.type) {
if ("eof" === P.type) {
throw invalidEOF();
}
switch (j.value) {
switch (P.value) {
case ",":
S = "beforePropertyName";
T = "beforePropertyName";
return;

@@ -1140,8 +1602,8 @@

afterArrayValue: function afterArrayValue() {
if ("eof" === j.type) {
if ("eof" === P.type) {
throw invalidEOF();
}
switch (j.value) {
switch (P.value) {
case ",":
S = "beforeArrayValue";
T = "beforeArrayValue";
return;

@@ -1157,5 +1619,5 @@

var u;
switch (j.type) {
switch (P.type) {
case "punctuator":
switch (j.value) {
switch (P.value) {
case "{":

@@ -1174,3 +1636,3 @@ u = {};

case "string":
u = j.value;
u = P.value;
}

@@ -1180,7 +1642,7 @@ if (void 0 === I) {

} else {
var D = P[P.length - 1];
if (Array.isArray(D)) {
D.push(u);
var e = b[b.length - 1];
if (Array.isArray(e)) {
e.push(u);
} else {
Object.defineProperty(D, T, {
Object.defineProperty(e, _, {
value: u,

@@ -1194,16 +1656,16 @@ writable: !0,

if (null !== u && "object" == typeof u) {
P.push(u);
b.push(u);
if (Array.isArray(u)) {
S = "beforeArrayValue";
T = "beforeArrayValue";
} else {
S = "beforePropertyName";
T = "beforePropertyName";
}
} else {
var e = P[P.length - 1];
if (null == e) {
S = "end";
} else if (Array.isArray(e)) {
S = "afterArrayValue";
var r = b[b.length - 1];
if (null == r) {
T = "end";
} else if (Array.isArray(r)) {
T = "afterArrayValue";
} else {
S = "afterPropertyValue";
T = "afterPropertyValue";
}

@@ -1213,10 +1675,10 @@ }

function pop() {
P.pop();
var u = P[P.length - 1];
b.pop();
var u = b[b.length - 1];
if (null == u) {
S = "end";
T = "end";
} else if (Array.isArray(u)) {
S = "afterArrayValue";
T = "afterArrayValue";
} else {
S = "afterPropertyValue";
T = "afterPropertyValue";
}

@@ -1226,11 +1688,11 @@ }

if (void 0 === u) {
return syntaxError("JSON5: invalid end of input at " + k + ":" + O);
return syntaxError("JSON5: invalid end of input at " + N + ":" + k);
}
return syntaxError("JSON5: invalid character '" + formatChar(u) + "' at " + k + ":" + O);
return syntaxError("JSON5: invalid character '" + formatChar(u) + "' at " + N + ":" + k);
}
function invalidEOF() {
return syntaxError("JSON5: invalid end of input at " + k + ":" + O);
return syntaxError("JSON5: invalid end of input at " + N + ":" + k);
}
function invalidIdentifier() {
return syntaxError("JSON5: invalid identifier character at " + k + ":" + (O -= 5));
return syntaxError("JSON5: invalid identifier character at " + N + ":" + (k -= 5));
}

@@ -1241,3 +1703,3 @@ function separatorChar(u) {

function formatChar(u) {
var D = {
var e = {
"'": "\\'",

@@ -1256,8 +1718,8 @@ '"': '\\"',

};
if (D[u]) {
return D[u];
if (e[u]) {
return e[u];
}
if (u < " ") {
var e = u.charCodeAt(0).toString(16);
return "\\x" + ("00" + e).substring(e.length);
var r = u.charCodeAt(0).toString(16);
return "\\x" + ("00" + r).substring(r.length);
}

@@ -1267,249 +1729,335 @@ return u;

function syntaxError(u) {
var D = new SyntaxError(u);
D.lineNumber = k;
D.columnNumber = O;
return D;
var e = new SyntaxError(u);
e.lineNumber = N;
e.columnNumber = k;
return e;
}
var H = {
parse: _,
stringify: function stringify(u, D, e) {
var r = [];
var n = "";
var t;
var a;
var i = "";
var F;
if (null != D && "object" == typeof D && !Array.isArray(D)) {
e = D.space;
F = D.quote;
D = D.replacer;
}
if ("function" == typeof D) {
a = D;
} else if (Array.isArray(D)) {
t = [];
for (var C = 0, A = D; C < A.length; C += 1) {
var E = A[C];
var o = void 0;
if ("string" == typeof E) {
o = E;
} else if ("number" == typeof E || E instanceof String || E instanceof Number) {
o = String(E);
}
if (void 0 !== o && t.indexOf(o) < 0) {
t.push(o);
}
var R = function stringify(u, e, r) {
var t = [];
var D = "";
var a;
var n;
var i = "";
var o;
if (null != e && "object" == typeof e && !Array.isArray(e)) {
r = e.space;
o = e.quote;
e = e.replacer;
}
if ("function" == typeof e) {
n = e;
} else if (Array.isArray(e)) {
a = [];
for (var s = 0, F = e; s < F.length; s += 1) {
var c = F[s];
var C = void 0;
if ("string" == typeof c) {
C = c;
} else if ("number" == typeof c || c instanceof String || c instanceof Number) {
C = String(c);
}
if (void 0 !== C && a.indexOf(C) < 0) {
a.push(C);
}
}
if (e instanceof Number) {
e = Number(e);
} else if (e instanceof String) {
e = String(e);
}
if (r instanceof Number) {
r = Number(r);
} else if (r instanceof String) {
r = String(r);
}
if ("number" == typeof r) {
if (r > 0) {
r = Math.min(10, Math.floor(r));
i = " ".substr(0, r);
}
if ("number" == typeof e) {
if (e > 0) {
e = Math.min(10, Math.floor(e));
i = " ".substr(0, e);
} else if ("string" == typeof r) {
i = r.substr(0, 10);
}
return serializeProperty("", {
"": u
});
function serializeProperty(u, e) {
var r = e[u];
if (null != r) {
if ("function" == typeof r.toJSON5) {
r = r.toJSON5(u);
} else if ("function" == typeof r.toJSON) {
r = r.toJSON(u);
}
} else if ("string" == typeof e) {
i = e.substr(0, 10);
}
return serializeProperty("", {
"": u
});
function serializeProperty(u, D) {
var e = D[u];
if (null != e) {
if ("function" == typeof e.toJSON5) {
e = e.toJSON5(u);
} else if ("function" == typeof e.toJSON) {
e = e.toJSON(u);
}
}
if (a) {
e = a.call(D, u, e);
}
if (e instanceof Number) {
e = Number(e);
} else if (e instanceof String) {
e = String(e);
} else if (e instanceof Boolean) {
e = e.valueOf();
}
switch (e) {
case null:
return "null";
if (n) {
r = n.call(e, u, r);
}
if (r instanceof Number) {
r = Number(r);
} else if (r instanceof String) {
r = String(r);
} else if (r instanceof Boolean) {
r = r.valueOf();
}
switch (r) {
case null:
return "null";
case !0:
return "true";
case !0:
return "true";
case !1:
return "false";
}
if ("string" == typeof e) {
return quoteString(e);
}
if ("number" == typeof e) {
return String(e);
}
if ("object" == typeof e) {
return Array.isArray(e) ? serializeArray(e) : serializeObject(e);
}
return;
case !1:
return "false";
}
function quoteString(u) {
var D = {
"'": .1,
'"': .2
};
var e = {
"'": "\\'",
'"': '\\"',
"\\": "\\\\",
"\b": "\\b",
"\f": "\\f",
"\n": "\\n",
"\r": "\\r",
"\t": "\\t",
"\v": "\\v",
"\0": "\\0",
"\u2028": "\\u2028",
"\u2029": "\\u2029"
};
var r = "";
for (var n = 0; n < u.length; n++) {
var t = u[n];
switch (t) {
case "'":
case '"':
D[t]++;
r += t;
continue;
if ("string" == typeof r) {
return quoteString(r);
}
if ("number" == typeof r) {
return String(r);
}
if ("object" == typeof r) {
return Array.isArray(r) ? serializeArray(r) : serializeObject(r);
}
return;
}
function quoteString(u) {
var e = {
"'": .1,
'"': .2
};
var r = {
"'": "\\'",
'"': '\\"',
"\\": "\\\\",
"\b": "\\b",
"\f": "\\f",
"\n": "\\n",
"\r": "\\r",
"\t": "\\t",
"\v": "\\v",
"\0": "\\0",
"\u2028": "\\u2028",
"\u2029": "\\u2029"
};
var t = "";
for (var D = 0; D < u.length; D++) {
var a = u[D];
switch (a) {
case "'":
case '"':
e[a]++;
t += a;
continue;
case "\0":
if (b.isDigit(u[n + 1])) {
r += "\\x00";
continue;
}
}
if (e[t]) {
r += e[t];
case "\0":
if (w.isDigit(u[D + 1])) {
t += "\\x00";
continue;
}
if (t < " ") {
var a = t.charCodeAt(0).toString(16);
r += "\\x" + ("00" + a).substring(a.length);
continue;
}
r += t;
}
var i = F || Object.keys(D).reduce((function(u, e) {
return D[u] < D[e] ? u : e;
}));
return i + (r = r.replace(new RegExp(i, "g"), e[i])) + i;
if (r[a]) {
t += r[a];
continue;
}
if (a < " ") {
var n = a.charCodeAt(0).toString(16);
t += "\\x" + ("00" + n).substring(n.length);
continue;
}
t += a;
}
function serializeObject(u) {
if (r.indexOf(u) >= 0) {
throw TypeError("Converting circular structure to JSON5");
}
r.push(u);
var D = n;
n += i;
var e = [];
for (var a = 0, F = t || Object.keys(u); a < F.length; a += 1) {
var C = F[a];
var A = serializeProperty(C, u);
if (void 0 !== A) {
var E = serializeKey(C) + ":";
if ("" !== i) {
E += " ";
}
e.push(E += A);
var i = o || Object.keys(e).reduce((function(u, r) {
return e[u] < e[r] ? u : r;
}));
return i + (t = t.replace(new RegExp(i, "g"), r[i])) + i;
}
function serializeObject(u) {
if (t.indexOf(u) >= 0) {
throw TypeError("Converting circular structure to JSON5");
}
t.push(u);
var e = D;
D += i;
var r = [];
for (var n = 0, o = a || Object.keys(u); n < o.length; n += 1) {
var s = o[n];
var F = serializeProperty(s, u);
if (void 0 !== F) {
var c = serializeKey(s) + ":";
if ("" !== i) {
c += " ";
}
r.push(c += F);
}
var o;
if (0 === e.length) {
o = "{}";
}
var C;
if (0 === r.length) {
C = "{}";
} else {
var A;
if ("" === i) {
C = "{" + (A = r.join(",")) + "}";
} else {
var c;
if ("" === i) {
o = "{" + (c = e.join(",")) + "}";
} else {
c = e.join(",\n" + n);
o = "{\n" + n + c + ",\n" + D + "}";
}
A = r.join(",\n" + D);
C = "{\n" + D + A + ",\n" + e + "}";
}
r.pop();
n = D;
return o;
}
function serializeKey(u) {
if (0 === u.length) {
t.pop();
D = e;
return C;
}
function serializeKey(u) {
if (0 === u.length) {
return quoteString(u);
}
var e = String.fromCodePoint(u.codePointAt(0));
if (!w.isIdStartChar(e)) {
return quoteString(u);
}
for (var r = e.length; r < u.length; r++) {
if (!w.isIdContinueChar(String.fromCodePoint(u.codePointAt(r)))) {
return quoteString(u);
}
var D = String.fromCodePoint(u.codePointAt(0));
if (!b.isIdStartChar(D)) {
return quoteString(u);
}
for (var e = D.length; e < u.length; e++) {
if (!b.isIdContinueChar(String.fromCodePoint(u.codePointAt(e)))) {
return quoteString(u);
}
}
return u;
}
function serializeArray(u) {
if (r.indexOf(u) >= 0) {
throw TypeError("Converting circular structure to JSON5");
}
r.push(u);
var D = n;
n += i;
var e = [];
for (var t = 0; t < u.length; t++) {
var a = serializeProperty(String(t), u);
e.push(void 0 !== a ? a : "null");
}
var F;
if (0 === e.length) {
F = "[]";
} else if ("" === i) {
F = "[" + e.join(",") + "]";
} else {
var C = e.join(",\n" + n);
F = "[\n" + n + C + ",\n" + D + "]";
}
r.pop();
n = D;
return F;
return u;
}
function serializeArray(u) {
if (t.indexOf(u) >= 0) {
throw TypeError("Converting circular structure to JSON5");
}
t.push(u);
var e = D;
D += i;
var r = [];
for (var a = 0; a < u.length; a++) {
var n = serializeProperty(String(a), u);
r.push(void 0 !== n ? n : "null");
}
var o;
if (0 === r.length) {
o = "[]";
} else if ("" === i) {
o = "[" + r.join(",") + "]";
} else {
var s = r.join(",\n" + D);
o = "[\n" + D + s + ",\n" + e + "]";
}
t.pop();
D = e;
return o;
}
};
var R = H;
return R;
var $ = {
parse: O,
stringify: R
};
var U = $;
return U;
}();
var e = getDefaultExportFromCjs(D.exports);
var g = getDefaultExportFromCjs(h.exports);
var resolveTypeScriptRootDir = (D, r) => {
var n = D(r);
var t = e.parse(n);
var resolveTypeScriptRootDir = (u, e) => {
var r = u(e);
var t = g.parse(r);
if (t.compilerOptions && t.compilerOptions.plugins && t.compilerOptions.plugins.find((u => "@0no-co/graphqlsp" === u.name || "gql.tada/lsp" === u.name))) {
return u.dirname(r);
return D.dirname(e);
} else if (Array.isArray(t.extends)) {
return t.extends.find((e => {
var n = require.resolve(e, {
paths: [ u.dirname(r) ]
return t.extends.find((r => {
var t = require.resolve(r, {
paths: [ D.dirname(e) ]
});
return resolveTypeScriptRootDir(D, n);
return resolveTypeScriptRootDir(u, t);
}));
} else if (t.extends) {
var a = require.resolve(t.extends, {
paths: [ u.dirname(r) ]
paths: [ D.dirname(e) ]
});
return resolveTypeScriptRootDir(D, a);
return resolveTypeScriptRootDir(u, a);
}
};
exports.createProgram = createProgram;
exports.createVirtualHost = createVirtualHost;
exports.importLib = importLib;
exports.importModule = importModule;
exports.minifyIntrospection = function minifyIntrospection(u) {
return ((u, e = {}) => {
if (!u || !("__schema" in u)) {
throw new TypeError("Expected to receive an IntrospectionQuery.");
}
E = !1;
c = !!e.includeScalars;
C = !!e.includeEnums;
A = !!e.includeInputs;
var {__schema: {queryType: r, mutationType: t, subscriptionType: D, types: a, directives: n}} = u;
var i = a.filter((u => {
switch (u.name) {
case "__Directive":
case "__DirectiveLocation":
case "__EnumValue":
case "__InputValue":
case "__Field":
case "__Type":
case "__TypeKind":
case "__Schema":
return !1;
default:
return c && "SCALAR" === u.kind || C && "ENUM" === u.kind || A && "INPUT_OBJECT" === u.kind || "OBJECT" === u.kind || "INTERFACE" === u.kind || "UNION" === u.kind;
}
})).map(minifyIntrospectionType);
if (E) {
i.push({
kind: "SCALAR",
name: l.name
});
}
var o = [];
if (e.includeDirectives) {
o = (n || []).map((u => ({
name: u.name,
isRepeatable: u.isRepeatable ? !0 : void 0,
locations: u.locations,
args: u.args.map((u => ({
name: u.name,
type: mapType(u.type),
defaultValue: u.defaultValue || void 0
})))
})));
}
return {
__schema: {
queryType: r,
mutationType: t,
subscriptionType: D,
types: i,
directives: o
}
};
})(u, {
includeDirectives: !1,
includeEnums: !0,
includeInputs: !0,
includeScalars: !0
});
};
exports.outputIntrospectionFile = async function outputIntrospectionFile(u, e) {
if (/\.d\.ts$/.test(e.fileType)) {
var r = "string" != typeof u && e.shouldPreprocess ? await preprocessIntrospection(u) : stringifyJson(u);
return [ f, d, `export type introspection = ${r};\n`, "import * as gqlTada from 'gql.tada';\n", "declare module 'gql.tada' {", " interface setupSchema {", " introspection: introspection", " }", "}" ].join("\n");
} else if (/\.ts$/.test(e.fileType)) {
var t = stringifyJson(u);
return [ f, p, `const introspection = ${t} as const;\n`, "export { introspection };" ].join("\n");
}
throw new TadaError(`No available introspection format for "${e.fileType}" (expected ".ts" or ".d.ts")`);
};
exports.preprocessIntrospection = preprocessIntrospection;
exports.resolveModuleFile = resolveModuleFile;
exports.resolveTypeScriptRootDir = resolveTypeScriptRootDir;
//# sourceMappingURL=gql-tada-internal.js.map
{
"name": "@gql.tada/internal",
"version": "0.1.0-canary-0c7178c3869822f586e7b12fa5821ebbe662c993",
"version": "0.1.0-canary-3b1ef6d54e33b53835e16ccdbe85d5d99add2178",
"public": true,

@@ -38,2 +38,3 @@ "description": "Internal logic for gql.tada’s CLI tool and GraphQLSP.",

"devDependencies": {
"@urql/introspection": "^1.0.3",
"@types/node": "^20.11.0",

@@ -43,8 +44,7 @@ "json5": "^2.2.3",

"sade": "^1.8.1",
"type-fest": "^4.10.2",
"typescript": "^5.3.3"
"type-fest": "^4.10.2"
},
"dependencies": {
"@urql/introspection": "^1.0.3",
"graphql": "^16.8.1"
"graphql": "^16.8.1",
"typescript": "^5.3.3"
},

@@ -51,0 +51,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc