This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/prettier/parser-graphql.js

2 lines
35 KiB
JavaScript
Raw Normal View History

2019-08-11 18:48:02 +00:00
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e.prettierPlugins=e.prettierPlugins||{},e.prettierPlugins.graphql=n())}(this,function(){"use strict";function e(n){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(n)}var n=function(e,n){var t=new SyntaxError(e+" ("+n.start.line+":"+n.start.column+")");return t.loc=n,t};var t=function(e){return/^\s*#[^\n\S]*@(format|prettier)\s*(\n|$)/.test(e)};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function i(e,n){return e(n={exports:{}},n.exports),n.exports}var o=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.getLocation=function(e,n){var t=/\r\n|[\n\r]/g,r=1,i=n+1,o=void 0;for(;(o=t.exec(e.body))&&o.index<n;)r+=1,i=n+1-(o.index+o[0].length);return{line:r,column:i}}});r(o);var a=i(function(e,n){Object.defineProperty(n,"__esModule",{value:!0});n.Kind=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",VARIABLE:"Variable",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension",DIRECTIVE_DEFINITION:"DirectiveDefinition"})});r(a);var c=i(function(e,n){function t(e,n){var t=n.line,o=e.locationOffset.line-1,a=function(e,n){return 1===n.line?e.locationOffset.column-1:0}(e,n),c=t+o,u=n.column+a,s=(c-1).toString(),l=c.toString(),d=(c+1).toString(),f=d.length,v=e.body.split(/\r\n|[\n\r]/g);return v[0]=r(e.locationOffset.column-1)+v[0],[e.name+" ("+c+":"+u+")",t>=2&&i(f,s)+": "+v[t-2],i(f,l)+": "+v[t-1],r(2+f+u-1)+"^",t<v.length&&i(f,d)+": "+v[t]].filter(Boolean).join("\n")}function r(e){return Array(e+1).join(" ")}function i(e,n){return r(e-n.length)+n}Object.defineProperty(n,"__esModule",{value:!0}),n.printError=function(e){var n=[];if(e.nodes)e.nodes.forEach(function(e){e.loc&&n.push(t(e.loc.source,(0,o.getLocation)(e.loc.source,e.loc.start)))});else if(e.source&&e.locations){var r=e.source;e.locations.forEach(function(e){n.push(t(r,e))})}return 0===n.length?e.message:[e.message].concat(n).join("\n\n")+"\n"}});r(c);var u=i(function(e,n){function t(e,n,r,i,a,c,u){var s=Array.isArray(n)?0!==n.length?n:void 0:n?[n]:void 0,l=r;if(!l&&s){var d=s[0];l=d&&d.loc&&d.loc.source}var f=i;!f&&s&&(f=s.reduce(function(e,n){return n.loc&&e.push(n.loc.start),e},[])),f&&0===f.length&&(f=void 0);var v=void 0;i&&r?v=i.map(function(e){return(0,o.getLocation)(r,e)}):s&&(v=s.reduce(function(e,n){return n.loc&&e.push((0,o.getLocation)(n.loc.source,n.loc.start)),e},[])),Object.defineProperties(this,{message:{value:e,enumerable:!0,writable:!0},locations:{value:v||void 0,enumerable:!0},path:{value:a||void 0,enumerable:!0},nodes:{value:s||void 0},source:{value:l||void 0},positions: