forked from kevin.shehu/GGD
2 lines
40 KiB
JavaScript
2 lines
40 KiB
JavaScript
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).prettierPlugins=e.prettierPlugins||{},e.prettierPlugins.graphql=t())}(this,(function(){"use strict";var e=function(e,t){const n=new SyntaxError(e+" ("+t.start.line+":"+t.start.column+")");return n.loc=t,n};var t=function(){let e;for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(const[t,i]of n.entries())try{return{result:i()}}catch(n){0===t&&(e=n)}return{error:e}};var n={hasPragma:function(e){return/^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/.test(e)},insertPragma:function(e){return"# @format\n\n"+e}};var i={locStart:function(e){return"number"==typeof e.start?e.start:e.loc&&e.loc.start},locEnd:function(e){return"number"==typeof e.end?e.end:e.loc&&e.loc.end}},r={},o={};function a(e){return a="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},a(e)}Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e){return"object"==a(e)&&null!==e};var s={};Object.defineProperty(s,"__esModule",{value:!0}),s.SYMBOL_TO_STRING_TAG=s.SYMBOL_ASYNC_ITERATOR=s.SYMBOL_ITERATOR=void 0;var c="function"==typeof Symbol&&null!=Symbol.iterator?Symbol.iterator:"@@iterator";s.SYMBOL_ITERATOR=c;var u="function"==typeof Symbol&&null!=Symbol.asyncIterator?Symbol.asyncIterator:"@@asyncIterator";s.SYMBOL_ASYNC_ITERATOR=u;var l="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag";s.SYMBOL_TO_STRING_TAG=l;var p={};Object.defineProperty(p,"__esModule",{value:!0}),p.getLocation=function(e,t){var n,i=/\r\n|[\n\r]/g,r=1,o=t+1;for(;(n=i.exec(e.body))&&n.index<t;)r+=1,o=t+1-(n.index+n[0].length);return{line:r,column:o}};var d={};Object.defineProperty(d,"__esModule",{value:!0}),d.printLocation=function(e){return f(e.source,(0,h.getLocation)(e.source,e.start))},d.printSourceLocation=f;var h=p;function f(e,t){var n=e.locationOffset.column-1,i=v(n)+e.body,r=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=1===t.line?n:0,c=t.column+s,u="".concat(e.name,":").concat(a,":").concat(c,"\n"),l=i.split(/\r\n|[\n\r]/g),p=l[r];if(p.length>120){for(var d=Math.floor(c/80),h=c%80,f=[],E=0;E<p.length;E+=80)f.push(p.slice(E,E+80));return u+T([["".concat(a),f[0]]].concat(f.slice(1,d+1).map((function(e){return["",e]})),[[" ",v(h-1)+"^"],["",f[d+1]]]))}return u+T([["".concat(a-1),l[r-1]],["".concat(a),p],["",v(c-1)+"^"],["".concat(a+1),l[r+1]]])}function T(e){var t=e.filter((function(e){return e[0],void 0!==e[1]})),n=Math.max.apply(Math,t.map((function(e){return e[0].length})));return t.map((function(e){var t,i=e[0],r=e[1];return v(n-(t=i).length)+t+(r?" | "+r:" |")})).join("\n")}function v(e){return Array(e+1).join(" ")}function E(e){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},E(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.printError=R,r.GraphQLError=void 0;var k,N=(k=o)&&k.__esModule?k:{default:k},y=s,_=p,I=d;function O(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function m(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?A(e):t}function A(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x(e){var t="function"==typeof Map?new Map:void 0;return x=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return K(e,arguments,b(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumera
|