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

@0no-co/graphql.web

Package Overview
Dependencies
Maintainers
2
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@0no-co/graphql.web - npm Package Compare versions

Comparing version 1.0.5-canary-3f3b440609b30b6a7775f617f6df419b1d306731 to 1.0.5-canary-896f588a807bd3ccf890eaf48fe0654bb684a278

790

dist/graphql.web.js

@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {

class GraphQLError extends Error {
constructor(e, r, i, n, t, a, o) {
constructor(e, r, i, n, a, t, o) {
super(e);
this.name = "GraphQLError";
this.message = e;
if (t) {
this.path = t;
if (a) {
this.path = a;
}

@@ -23,8 +23,8 @@ if (r) {

}
if (a) {
this.originalError = a;
if (t) {
this.originalError = t;
}
var l = o;
if (!l && a) {
var u = a.extensions;
if (!l && t) {
var u = t.extensions;
if (u && "object" == typeof u) {

@@ -70,4 +70,4 @@ l = u;

var n = "";
var a = 0;
var t = 0;
var a = 0;
var o = r.length - 1;

@@ -77,14 +77,14 @@ for (var l = 0; l < r.length; l++) {

if (i.test(r[l])) {
if (l && (!t || i.lastIndex < t)) {
t = i.lastIndex;
if (l && (!a || i.lastIndex < a)) {
a = i.lastIndex;
}
a = a || l;
t = t || l;
o = l;
}
}
for (var u = a; u <= o; u++) {
if (u !== a) {
for (var u = t; u <= o; u++) {
if (u !== t) {
n += "\n";
}
n += r[u].slice(t).replace(/\\"""/g, '"""');
n += r[u].slice(a).replace(/\\"""/g, '"""');
}

@@ -105,138 +105,129 @@ return n;

function name() {
var e;
if (e = advance(n)) {
return {
kind: "Name",
value: e
};
}
}
var a = new RegExp("(?:(null|true|false)|\\$(" + n.source + ')|(-?\\d+)((?:\\.\\d+)?[eE][+-]?\\d+|\\.\\d+)?|("""(?:"""|(?:[\\s\\S]*?[^\\\\])"""))|("(?:"|[^\\r\\n]*?[^\\\\]"))|(' + n.source + "))", "y");
var t = /(?:null|true|false)/y;
var t = function(e) {
e[e.Const = 1] = "Const";
e[e.Var = 2] = "Var";
e[e.Int = 3] = "Int";
e[e.Float = 4] = "Float";
e[e.BlockString = 5] = "BlockString";
e[e.String = 6] = "String";
e[e.Enum = 7] = "Enum";
return e;
}(t || {});
var a = /\$[_A-Za-z]\w*/y;
var o = /\\/g;
var o = /-?\d+/y;
var l = /(?:\.\d+)?[eE][+-]?\d+|\.\d+/y;
var u = /\\/g;
var v = /"""(?:"""|(?:[\s\S]*?[^\\])""")/y;
var d = /"(?:"|[^\r\n]*?[^\\]")/y;
function value(i) {
var s;
var c;
if (c = advance(t)) {
s = "null" === c ? {
kind: "NullValue"
} : {
kind: "BooleanValue",
value: "true" === c
var l;
var u;
a.lastIndex = r;
if (91 === e.charCodeAt(r)) {
r++;
ignored();
var d = [];
while (93 !== e.charCodeAt(r)) {
d.push(value(i));
}
r++;
ignored();
return {
kind: "ListValue",
values: d
};
} else if (!i && (c = advance(a))) {
s = {
kind: "Variable",
name: {
kind: "Name",
value: c.slice(1)
} else if (123 === e.charCodeAt(r)) {
r++;
ignored();
var s = [];
while (125 !== e.charCodeAt(r)) {
if (null == (l = advance(n))) {
throw error("ObjectField");
}
};
} else if (c = advance(o)) {
var f = c;
if (c = advance(l)) {
s = {
kind: "FloatValue",
value: f + c
};
} else {
s = {
kind: "IntValue",
value: f
};
}
} else if (c = advance(n)) {
s = {
kind: "EnumValue",
value: c
};
} else if (c = advance(v)) {
s = {
kind: "StringValue",
value: blockString(c.slice(3, -3)),
block: !0
};
} else if (c = advance(d)) {
s = {
kind: "StringValue",
value: u.test(c) ? JSON.parse(c) : c.slice(1, -1),
block: !1
};
} else if (s = function list(i) {
var n;
if (91 === e.charCodeAt(r)) {
r++;
ignored();
var t = [];
while (n = value(i)) {
t.push(n);
if (58 !== e.charCodeAt(r++)) {
throw error("ObjectField");
}
if (93 !== e.charCodeAt(r++)) {
throw error("ListValue");
}
ignored();
return {
kind: "ListValue",
values: t
s.push({
kind: "ObjectField",
name: {
kind: "Name",
value: l
},
value: value(i)
});
}
r++;
ignored();
return {
kind: "ObjectValue",
fields: s
};
} else if (null != (u = a.exec(e))) {
r = a.lastIndex;
ignored();
if (null != (l = u[t.Const])) {
return "null" === l ? {
kind: "NullValue"
} : {
kind: "BooleanValue",
value: "true" === l
};
}
}(i) || function object(i) {
if (123 === e.charCodeAt(r)) {
r++;
ignored();
var n = [];
var t;
while (t = name()) {
ignored();
if (58 !== e.charCodeAt(r++)) {
throw error("ObjectField");
}
ignored();
var a = value(i);
if (!a) {
throw error("ObjectField");
}
n.push({
kind: "ObjectField",
name: t,
value: a
});
} else if (null != (l = u[t.Var])) {
if (i) {
throw error("Variable");
} else {
return {
kind: "Variable",
name: {
kind: "Name",
value: l
}
};
}
if (125 !== e.charCodeAt(r++)) {
throw error("ObjectValue");
} else if (null != (l = u[t.Int])) {
var v;
if (null != (v = u[t.Float])) {
return {
kind: "FloatValue",
value: l + v
};
} else {
return {
kind: "IntValue",
value: l
};
}
ignored();
} else if (null != (l = u[t.BlockString])) {
return {
kind: "ObjectValue",
fields: n
kind: "StringValue",
value: blockString(l.slice(3, -3)),
block: !0
};
} else if (null != (l = u[t.String])) {
return {
kind: "StringValue",
value: o.test(l) ? JSON.parse(l) : l.slice(1, -1),
block: !1
};
} else if (null != (l = u[t.Enum])) {
return {
kind: "EnumValue",
value: l
};
}
}(i)) {
return s;
}
ignored();
return s;
throw error("Value");
}
function arguments_(i) {
var n = [];
ignored();
if (40 === e.charCodeAt(r)) {
var a = [];
r++;
ignored();
var t;
while (t = name()) {
do {
if (null == (t = advance(n))) {
throw error("Argument");
}
ignored();

@@ -247,61 +238,37 @@ if (58 !== e.charCodeAt(r++)) {

ignored();
var a = value(i);
if (!a) {
throw error("Argument");
}
n.push({
a.push({
kind: "Argument",
name: t,
value: a
name: {
kind: "Name",
value: t
},
value: value(i)
});
}
if (!n.length || 41 !== e.charCodeAt(r++)) {
throw error("Argument");
}
} while (41 !== e.charCodeAt(r));
r++;
ignored();
return a;
}
return n;
}
function directives(i) {
var n = [];
ignored();
while (64 === e.charCodeAt(r)) {
r++;
var t = name();
if (!t) {
throw error("Directive");
}
ignored();
n.push({
kind: "Directive",
name: t,
arguments: arguments_(i)
});
}
return n;
}
function field() {
var i = name();
if (i) {
ignored();
var n;
if (58 === e.charCodeAt(r)) {
if (64 === e.charCodeAt(r)) {
var a = [];
var t;
do {
r++;
ignored();
n = i;
if (!(i = name())) {
throw error("Field");
if (null == (t = advance(n))) {
throw error("Directive");
}
ignored();
}
return {
kind: "Field",
alias: n,
name: i,
arguments: arguments_(!1),
directives: directives(!1),
selectionSet: selectionSet()
};
a.push({
kind: "Directive",
name: {
kind: "Name",
value: t
},
arguments: arguments_(i)
});
} while (64 === e.charCodeAt(r));
return a;
}

@@ -312,151 +279,205 @@ }

var i;
ignored();
if (91 === e.charCodeAt(r)) {
var a = 0;
while (91 === e.charCodeAt(r)) {
a++;
r++;
ignored();
var n = type();
if (!n || 93 !== e.charCodeAt(r++)) {
throw error("ListType");
}
i = {
kind: "ListType",
type: n
};
} else if (i = name()) {
i = {
kind: "NamedType",
name: i
};
} else {
}
if (null == (i = advance(n))) {
throw error("NamedType");
}
ignored();
if (33 === e.charCodeAt(r)) {
r++;
ignored();
return {
kind: "NonNullType",
type: i
};
} else {
return i;
}
}
var s = /on/y;
function typeCondition() {
if (advance(s)) {
ignored();
var e = name();
if (!e) {
throw error("NamedType");
var t = {
kind: "NamedType",
name: {
kind: "Name",
value: i
}
ignored();
return {
kind: "NamedType",
name: e
};
}
}
var c = /\.\.\./y;
function fragmentSpread() {
if (advance(c)) {
ignored();
var e = r;
var i;
if ((i = name()) && "on" !== i.value) {
return {
kind: "FragmentSpread",
name: i,
directives: directives(!1)
};
do {
if (33 === e.charCodeAt(r)) {
r++;
ignored();
t = {
kind: "NonNullType",
type: t
};
} else {
r = e;
var n = typeCondition();
var t = directives(!1);
var a = selectionSet();
if (!a) {
throw error("InlineFragment");
}
if (a) {
if (93 !== e.charCodeAt(r++)) {
throw error("NamedType");
}
return {
kind: "InlineFragment",
typeCondition: n,
directives: t,
selectionSet: a
ignored();
t = {
kind: "ListType",
type: t
};
}
}
} while (a--);
return t;
}
var l = new RegExp("(?:(\\.{3})|(" + n.source + "))", "y");
var u = function(e) {
e[e.Spread = 1] = "Spread";
e[e.Name = 2] = "Name";
return e;
}(u || {});
function selectionSet() {
var i;
ignored();
if (123 === e.charCodeAt(r)) {
r++;
ignored();
var n = [];
while (i = fragmentSpread() || field()) {
n.push(i);
}
if (!n.length || 125 !== e.charCodeAt(r++)) {
var i = [];
var a;
var t;
do {
l.lastIndex = r;
if (null != (t = l.exec(e))) {
r = l.lastIndex;
if (null != t[u.Spread]) {
ignored();
var o = advance(n);
if (null != o && "on" !== o) {
ignored();
i.push({
kind: "FragmentSpread",
name: {
kind: "Name",
value: o
},
directives: directives(!1)
});
} else {
ignored();
if ("on" === o) {
if (null == (o = advance(n))) {
throw error("NamedType");
}
ignored();
}
var d = directives(!1);
if (123 !== e.charCodeAt(r++)) {
throw error("InlineFragment");
}
ignored();
i.push({
kind: "InlineFragment",
typeCondition: o ? {
kind: "NamedType",
name: {
kind: "Name",
value: o
}
} : void 0,
directives: d,
selectionSet: selectionSet()
});
}
} else if (null != (a = t[u.Name])) {
var s = void 0;
ignored();
if (58 === e.charCodeAt(r)) {
r++;
ignored();
s = a;
if (null == (a = advance(n))) {
throw error("Field");
}
}
var v = arguments_(!1);
ignored();
var c = directives(!1);
var f = void 0;
if (123 === e.charCodeAt(r)) {
r++;
ignored();
f = selectionSet();
}
i.push({
kind: "Field",
alias: s ? {
kind: "Name",
value: s
} : void 0,
name: {
kind: "Name",
value: a
},
arguments: v,
directives: c,
selectionSet: f
});
}
} else {
throw error("SelectionSet");
}
ignored();
return {
kind: "SelectionSet",
selections: n
};
}
} while (125 !== e.charCodeAt(r));
r++;
ignored();
return {
kind: "SelectionSet",
selections: i
};
}
var f = /fragment/y;
function fragmentDefinition() {
if (advance(f)) {
ignored();
var e = name();
if (!e) {
throw error("FragmentDefinition");
}
ignored();
var r = typeCondition();
if (!r) {
throw error("FragmentDefinition");
}
var i = directives(!1);
var n = selectionSet();
if (!n) {
throw error("FragmentDefinition");
}
return {
kind: "FragmentDefinition",
name: e,
typeCondition: r,
directives: i,
selectionSet: n
};
var i;
var a;
if (null == (i = advance(n))) {
throw error("FragmentDefinition");
}
ignored();
if ("on" !== advance(n)) {
throw error("FragmentDefinition");
}
ignored();
if (null == (a = advance(n))) {
throw error("FragmentDefinition");
}
ignored();
var t = directives(!1);
if (123 !== e.charCodeAt(r++)) {
throw error("FragmentDefinition");
}
ignored();
return {
kind: "FragmentDefinition",
name: {
kind: "Name",
value: i
},
typeCondition: {
kind: "NamedType",
name: {
kind: "Name",
value: a
}
},
directives: t,
selectionSet: selectionSet()
};
}
var p = /(?:query|mutation|subscription)/y;
var d = /(?:query|mutation|subscription|fragment)/y;
function operationDefinition() {
var i;
var n;
var t = [];
var o = [];
if (i = advance(p)) {
function operationDefinition(i) {
var a;
var t;
var o;
if (i) {
ignored();
n = name();
a = advance(n);
t = function variableDefinitions() {
var i;
var n = [];
ignored();
if (40 === e.charCodeAt(r)) {
var i = [];
r++;
ignored();
while (i = advance(a)) {
var a;
do {
if (36 !== e.charCodeAt(r++)) {
throw error("Variable");
}
if (null == (a = advance(n))) {
throw error("Variable");
}
ignored();

@@ -466,2 +487,3 @@ if (58 !== e.charCodeAt(r++)) {

}
ignored();
var t = type();

@@ -472,8 +494,6 @@ var o = void 0;

ignored();
if (!(o = value(!0))) {
throw error("VariableDefinition");
}
o = value(!0);
}
ignored();
n.push({
i.push({
kind: "VariableDefinition",

@@ -484,3 +504,3 @@ variable: {

kind: "Name",
value: i.slice(1)
value: a
}

@@ -492,21 +512,23 @@ },

});
}
if (41 !== e.charCodeAt(r++)) {
throw error("VariableDefinition");
}
} while (41 !== e.charCodeAt(r));
r++;
ignored();
return i;
}
return n;
}();
o = directives(!1);
}
var l = selectionSet();
if (l) {
if (123 === e.charCodeAt(r)) {
r++;
ignored();
return {
kind: "OperationDefinition",
operation: i || "query",
name: n,
name: a ? {
kind: "Name",
value: a
} : void 0,
variableDefinitions: t,
directives: o,
selectionSet: l
selectionSet: selectionSet()
};

@@ -516,3 +538,3 @@ }

var m = {};
var s = {};

@@ -529,6 +551,6 @@ function printString(e) {

var g = {
var v = {
OperationDefinition(e) {
if ("query" === e.operation && !e.name && !hasItems(e.variableDefinitions) && !hasItems(e.directives)) {
return g.SelectionSet(e.selectionSet);
return v.SelectionSet(e.selectionSet);
}

@@ -543,11 +565,11 @@ var r = e.operation;

}
r += "(" + e.variableDefinitions.map(g.VariableDefinition).join(", ") + ")";
r += "(" + e.variableDefinitions.map(v.VariableDefinition).join(", ") + ")";
}
if (hasItems(e.directives)) {
r += " " + e.directives.map(g.Directive).join(" ");
r += " " + e.directives.map(v.Directive).join(" ");
}
return r + " " + g.SelectionSet(e.selectionSet);
return r + " " + v.SelectionSet(e.selectionSet);
},
VariableDefinition(e) {
var r = g.Variable(e.variable) + ": " + print(e.type);
var r = v.Variable(e.variable) + ": " + print(e.type);
if (e.defaultValue) {

@@ -557,3 +579,3 @@ r += " = " + print(e.defaultValue);

if (hasItems(e.directives)) {
r += " " + e.directives.map(g.Directive).join(" ");
r += " " + e.directives.map(v.Directive).join(" ");
}

@@ -565,3 +587,3 @@ return r;

if (hasItems(e.arguments)) {
var i = e.arguments.map(g.Argument);
var i = e.arguments.map(v.Argument);
var n = r + "(" + i.join(", ") + ")";

@@ -571,5 +593,5 @@ r = n.length > 80 ? r + "(\n " + i.join("\n").replace(/\n/g, "\n ") + "\n)" : n;

if (hasItems(e.directives)) {
r += " " + e.directives.map(g.Directive).join(" ");
r += " " + e.directives.map(v.Directive).join(" ");
}
return e.selectionSet ? r + " " + g.SelectionSet(e.selectionSet) : r;
return e.selectionSet ? r + " " + v.SelectionSet(e.selectionSet) : r;
},

@@ -585,3 +607,3 @@ StringValue: e => e.block ? printBlockString(e.value) : printString(e.value),

ListValue: e => "[" + e.values.map(print).join(", ") + "]",
ObjectValue: e => "{" + e.fields.map(g.ObjectField).join(", ") + "}",
ObjectValue: e => "{" + e.fields.map(v.ObjectField).join(", ") + "}",
ObjectField: e => e.name.value + ": " + print(e.value),

@@ -594,3 +616,3 @@ Document: e => hasItems(e.definitions) ? e.definitions.map(print).join("\n\n") : "",

if (hasItems(e.directives)) {
r += " " + e.directives.map(g.Directive).join(" ");
r += " " + e.directives.map(v.Directive).join(" ");
}

@@ -605,3 +627,3 @@ return r;

if (hasItems(e.directives)) {
r += " " + e.directives.map(g.Directive).join(" ");
r += " " + e.directives.map(v.Directive).join(" ");
}

@@ -614,3 +636,3 @@ return r + " " + print(e.selectionSet);

if (hasItems(e.directives)) {
r += " " + e.directives.map(g.Directive).join(" ");
r += " " + e.directives.map(v.Directive).join(" ");
}

@@ -622,3 +644,3 @@ return r + " " + print(e.selectionSet);

if (hasItems(e.arguments)) {
r += "(" + e.arguments.map(g.Argument).join(", ") + ")";
r += "(" + e.arguments.map(v.Argument).join(", ") + ")";
}

@@ -633,3 +655,3 @@ return r;

function print(e) {
return g[e.kind] ? g[e.kind](e) : "";
return v[e.kind] ? v[e.kind](e) : "";
}

@@ -661,7 +683,7 @@

case "ObjectValue":
var t = Object.create(null);
for (var a of e.fields) {
t[a.name.value] = valueFromASTUntyped(a.value, r);
var a = Object.create(null);
for (var t of e.fields) {
a[t.name.value] = valueFromASTUntyped(t.value, r);
}
return t;
return a;

@@ -673,3 +695,3 @@ case "Variable":

exports.BREAK = m;
exports.BREAK = s;

@@ -715,11 +737,19 @@ exports.GraphQLError = GraphQLError;

return function document() {
var e;
var i;
var n;
ignored();
var r = [];
while (e = fragmentDefinition() || operationDefinition()) {
r.push(e);
}
var a = [];
do {
if ("fragment" === (i = advance(d))) {
ignored();
a.push(fragmentDefinition());
} else if (null != (n = operationDefinition(i))) {
a.push(n);
} else {
throw error("Document");
}
} while (r < e.length);
return {
kind: "Document",
definitions: r
definitions: a
};

@@ -739,7 +769,3 @@ }();

ignored();
var t = value(!1);
if (!t) {
throw error("ValueNode");
}
return t;
return value(!1);
};

@@ -765,8 +791,8 @@

var n = [];
for (var t of e.values) {
var a = valueFromTypeNode(t, r.type, i);
if (void 0 === a) {
for (var a of e.values) {
var t = valueFromTypeNode(a, r.type, i);
if (void 0 === t) {
return;
} else {
n.push(a);
n.push(t);
}

@@ -794,6 +820,6 @@ }

try {
var t = function traverse(e, t, a) {
var a = function traverse(e, a, t) {
var o = !1;
var l = r[e.kind] && r[e.kind].enter || r[e.kind] || r.enter;
var u = l && l.call(r, e, t, a, n, i);
var u = l && l.call(r, e, a, t, n, i);
if (!1 === u) {

@@ -803,4 +829,4 @@ return e;

return null;
} else if (u === m) {
throw m;
} else if (u === s) {
throw s;
} else if (u && "string" == typeof u.kind) {

@@ -810,34 +836,34 @@ o = u !== e;

}
if (a) {
i.push(a);
if (t) {
i.push(t);
}
var v;
var d = {
var d;
var v = {
...e
};
for (var s in e) {
n.push(s);
var c = e[s];
if (Array.isArray(c)) {
var f = [];
for (var p = 0; p < c.length; p++) {
if (null != c[p] && "string" == typeof c[p].kind) {
for (var c in e) {
n.push(c);
var f = e[c];
if (Array.isArray(f)) {
var p = [];
for (var m = 0; m < f.length; m++) {
if (null != f[m] && "string" == typeof f[m].kind) {
i.push(e);
n.push(p);
v = traverse(c[p], p, c);
n.push(m);
d = traverse(f[m], m, f);
n.pop();
i.pop();
if (null == v) {
if (null == d) {
o = !0;
} else {
o = o || v !== c[p];
f.push(v);
o = o || d !== f[m];
p.push(d);
}
}
}
c = f;
} else if (null != c && "string" == typeof c.kind) {
if (void 0 !== (v = traverse(c, s, e))) {
o = o || c !== v;
c = v;
f = p;
} else if (null != f && "string" == typeof f.kind) {
if (void 0 !== (d = traverse(f, c, e))) {
o = o || f !== d;
f = d;
}

@@ -847,23 +873,23 @@ }

if (o) {
d[s] = c;
v[c] = f;
}
}
if (a) {
if (t) {
i.pop();
}
var g = r[e.kind] && r[e.kind].leave || r.leave;
var h = g && g.call(r, e, t, a, n, i);
if (h === m) {
throw m;
var h = g && g.call(r, e, a, t, n, i);
if (h === s) {
throw s;
} else if (void 0 !== h) {
return h;
} else if (void 0 !== u) {
return o ? d : u;
return o ? v : u;
} else {
return o ? d : e;
return o ? v : e;
}
}(e);
return void 0 !== t && !1 !== t ? t : e;
return void 0 !== a && !1 !== a ? a : e;
} catch (r) {
if (r !== m) {
if (r !== s) {
throw r;

@@ -870,0 +896,0 @@ }

{
"name": "@0no-co/graphql.web",
"description": "A spec-compliant client-side GraphQL implementation",
"version": "1.0.5-canary-3f3b440609b30b6a7775f617f6df419b1d306731",
"version": "1.0.5-canary-896f588a807bd3ccf890eaf48fe0654bb684a278",
"author": "0no.co <hi@0no.co>",

@@ -6,0 +6,0 @@ "source": "./src/index.ts",

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