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EF,QAAQ,YAAc,YACtB,IAAI,SAAW,YACf,QAAiB,QAAI,SACrB,IAAI,kBAAoB,IAAI,SAAS,kBAAkB,CACrD,KAAM,aACN,YAAa,8JACb,eAAgB,4EAChB,UAAW,aACX,WAAY,aACZ,aAAc,SAAsB,EAAK,GACvC,GAAI,EAAI,OAAS,UAAU,KAAK,OAC9B,MAAM,IAAI,UAAU,kDAAmD,EAAI,UAAU,OAAO,IAG9F,OAAO,YAAY,aAAc,EAAK,EACxC,IAEF,QAAQ,kBAAoB","file":"/npm/graphql-type-json@0.3.2/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/graphql-type-json@0.3.2/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\n\nexports.__esModule = true;\nexports.GraphQLJSONObject = exports[\"default\"] = exports.GraphQLJSON = void 0;\n\nvar _graphql = require(\"graphql\");\n\nvar _language = require(\"graphql/language\");\n\nfunction identity(value) {\n  return value;\n}\n\nfunction ensureObject(value) {\n  if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n    throw new TypeError(\"JSONObject cannot represent non-object value: \" + value);\n  }\n\n  return value;\n}\n\nfunction parseObject(typeName, ast, variables) {\n  var value = Object.create(null);\n  ast.fields.forEach(function (field) {\n    // eslint-disable-next-line no-use-before-define\n    value[field.name.value] = _parseLiteral(typeName, field.value, variables);\n  });\n  return value;\n}\n\nfunction _parseLiteral(typeName, ast, variables) {\n  switch (ast.kind) {\n    case _language.Kind.STRING:\n    case _language.Kind.BOOLEAN:\n      return ast.value;\n\n    case _language.Kind.INT:\n    case _language.Kind.FLOAT:\n      return parseFloat(ast.value);\n\n    case _language.Kind.OBJECT:\n      return parseObject(typeName, ast, variables);\n\n    case _language.Kind.LIST:\n      return ast.values.map(function (n) {\n        return _parseLiteral(typeName, n, variables);\n      });\n\n    case _language.Kind.NULL:\n      return null;\n\n    case _language.Kind.VARIABLE:\n      return variables ? variables[ast.name.value] : undefined;\n\n    default:\n      throw new TypeError(typeName + \" cannot represent value: \" + (0, _language.print)(ast));\n  }\n} // This named export is intended for users of CommonJS. Users of ES modules\n//  should instead use the default export.\n\n\nvar GraphQLJSON = new _graphql.GraphQLScalarType({\n  name: 'JSON',\n  description: 'The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).',\n  specifiedByUrl: 'http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf',\n  serialize: identity,\n  parseValue: identity,\n  parseLiteral: function parseLiteral(ast, variables) {\n    return _parseLiteral('JSON', ast, variables);\n  }\n});\nexports.GraphQLJSON = GraphQLJSON;\nvar _default = GraphQLJSON;\nexports[\"default\"] = _default;\nvar GraphQLJSONObject = new _graphql.GraphQLScalarType({\n  name: 'JSONObject',\n  description: 'The `JSONObject` scalar type represents JSON objects as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).',\n  specifiedByUrl: 'http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf',\n  serialize: ensureObject,\n  parseValue: ensureObject,\n  parseLiteral: function parseLiteral(ast, variables) {\n    if (ast.kind !== _language.Kind.OBJECT) {\n      throw new TypeError(\"JSONObject cannot represent non-object value: \" + (0, _language.print)(ast));\n    }\n\n    return parseObject('JSONObject', ast, variables);\n  }\n});\nexports.GraphQLJSONObject = GraphQLJSONObject;"]}