securityos/node_modules/prettier/parser-meriyah.js

19 lines
160 KiB
JavaScript
Raw Permalink Normal View History

2024-09-06 15:32:35 +00:00
(function(e){if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var i=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};i.prettierPlugins=i.prettierPlugins||{},i.prettierPlugins.meriyah=e()}})(function(){"use strict";var B=(a,g)=>()=>(g||a((g={exports:{}}).exports,g),g.exports);var k2=B((z3,Fu)=>{var A1=function(a){return a&&a.Math==Math&&a};Fu.exports=A1(typeof globalThis=="object"&&globalThis)||A1(typeof window=="object"&&window)||A1(typeof self=="object"&&self)||A1(typeof global=="object"&&global)||function(){return this}()||Function("return this")()});var w2=B((W3,Lu)=>{Lu.exports=function(a){try{return!!a()}catch{return!0}}});var S2=B((K3,Ou)=>{var to=w2();Ou.exports=!to(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var ue=B((Y3,Tu)=>{var oo=w2();Tu.exports=!oo(function(){var a=function(){}.bind();return typeof a!="function"||a.hasOwnProperty("prototype")})});var E1=B((Z3,Iu)=>{var lo=ue(),P1=Function.prototype.call;Iu.exports=lo?P1.bind(P1):function(){return P1.apply(P1,arguments)}});var ju=B(Vu=>{"use strict";var Ru={}.propertyIsEnumerable,Nu=Object.getOwnPropertyDescriptor,fo=Nu&&!Ru.call({1:2},1);Vu.f=fo?function(g){var m=Nu(this,g);return!!m&&m.enumerable}:Ru});var ie=B((G3,_u)=>{_u.exports=function(a,g){return{enumerable:!(a&1),configurable:!(a&2),writable:!(a&4),value:g}}});var F2=B((x3,Ju)=>{var Mu=ue(),Uu=Function.prototype,ne=Uu.call,co=Mu&&Uu.bind.bind(ne,ne);Ju.exports=Mu?co:function(a){return function(){return ne.apply(a,arguments)}}});var Xu=B((p3,Hu)=>{var $u=F2(),so=$u({}.toString),ao=$u("".slice);Hu.exports=function(a){return ao(so(a),8,-1)}});var Wu=B((ef,zu)=>{var go=F2(),ho=w2(),ro=Xu(),te=Object,mo=go("".split);zu.exports=ho(function(){return!te("z").propertyIsEnumerable(0)})?function(a){return ro(a)=="String"?mo(a,""):te(a)}:te});var oe=B((uf,Ku)=>{Ku.exports=function(a){return a==null}});var le=B((nf,Yu)=>{var bo=oe(),ko=TypeError;Yu.exports=function(a){if(bo(a))throw ko("Can't call method on "+a);return a}});var D1=B((tf,Zu)=>{var vo=Wu(),yo=le();Zu.exports=function(a){return vo(yo(a))}});var ce=B((of,Qu)=>{var fe=typeof document=="object"&&document.all,Ao=typeof fe>"u"&&fe!==void 0;Qu.exports={all:fe,IS_HTMLDDA:Ao}});var P2=B((lf,xu)=>{var Gu=ce(),Po=Gu.all;xu.exports=Gu.IS_HTMLDDA?function(a){return typeof a=="function"||a===Po}:function(a){return typeof a=="function"}});var Z2=B((ff,ui)=>{var pu=P2(),ei=ce(),Eo=ei.all;ui.exports=ei.IS_HTMLDDA?function(a){return typeof a=="object"?a!==null:pu(a)||a===Eo}:function(a){return typeof a=="object"?a!==null:pu(a)}});var C1=B((cf,ii)=>{var se=k2(),Do=P2(),Co=function(a){return Do(a)?a:void 0};ii.exports=function(a,g){return arguments.length<2?Co(se[a]):se[a]&&se[a][g]}});var ti=B((sf,ni)=>{var wo=F2();ni.exports=wo({}.isPrototypeOf)});var li=B((af,oi)=>{var qo=C1();oi.exports=qo("navigator","userAgent")||""});var hi=B((df,gi)=>{var di=k2(),ae=li(),fi=di.process,ci=di.Deno,si=fi&&fi.versions||ci&&ci.version,ai=si&&si.v8,E2,w1;ai&&(E2=ai.split("."),w1=E2[0]>0&&E2[0]<4?1:+(E2[0]+E2[1]));!w1&&ae&&(E2=ae.match(/Edge\/(\d+)/),(!E2||E2[1]>=74)&&(E2=ae.match(/Chrome\/(\d+)/),E2&&(w1=+E2[1])));gi.exports=w1});var de=B((gf,mi)=>{var ri=hi(),Bo=w2();mi.exports=!!Object.getOwnPropertySymbols&&!Bo(function(){var a=Symbol();return!String(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&ri&&ri<41})});var ge=B((hf,bi)=>{var So=de();bi.exports=So&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var he=B((rf,ki)=>{var Fo=C1(),Lo=P2(),Oo=ti(),To=ge(),Io=Object;ki.exports=To?function(a){return typeof a=="symbol"}:function(a){var g=Fo("Symbol");return Lo(g)&&Oo(g.prototype,Io(a))}});var yi=B((mf,vi)=>{var Ro=String;vi.exports=function(a){try{return Ro(a)}catch{return"Object"}}});var Pi=B((bf,Ai)=>{var No=P2(),Vo=yi(),jo=TypeError;Ai.exports=function(a){if(No(a))return a;throw jo(Vo(a)+" is not a function")}});var Di=B((kf,Ei)=>{var _o=Pi(),Mo=oe();Ei.exports=function(a,g){var m=a[g];return Mo(m)?void 0:_o(m)}});v
`,Ft={EOL:He,tmpdir:$e,tmpDir:Je,networkInterfaces:Bt,getNetworkInterfaces:St,release:qt,type:wt,cpus:Ct,totalmem:Dt,freemem:Et,uptime:Pt,loadavg:At,hostname:yt,endianness:vt}}}),E3=o2({"node-modules-polyfills-commonjs:os"(a,g){n2();var m=(P3(),k3(kt));if(m&&m.default){g.exports=m.default;for(let f in m)g.exports[f]=m[f]}else m&&(g.exports=m)}}),D3=o2({"node_modules/detect-newline/index.js"(a,g){"use strict";n2();var m=f=>{if(typeof f!="string")throw new TypeError("Expected a string");let A=f.match(/(?:\r?\n)/g)||[];if(A.length===0)return;let S=A.filter(N=>N===`\r
`).length,q=A.length-S;return S>q?`\r
`:`
`};g.exports=m,g.exports.graceful=f=>typeof f=="string"&&m(f)||`
`}}),C3=o2({"node_modules/jest-docblock/build/index.js"(a){"use strict";n2(),Object.defineProperty(a,"__esModule",{value:!0}),a.extract=e2,a.parse=Z,a.parseWithComments=R,a.print=j,a.strip=L;function g(){let O=E3();return g=function(){return O},O}function m(){let O=f(D3());return m=function(){return O},O}function f(O){return O&&O.__esModule?O:{default:O}}var A=/\*\/$/,S=/^\/\*\*?/,q=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,N=/(^|\s+)\/\/([^\r\n]*)/g,k=/^(\r?\n)+/,W=/(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *(?![^@\r\n]*\/\/[^]*)([^@\r\n\s][^@\r\n]+?) *\r?\n/g,$=/(?:^|\r?\n) *@(\S+) *([^\r\n]*)/g,z=/(\r?\n|^) *\* ?/g,Q=[];function e2(O){let u2=O.match(q);return u2?u2[0].trimLeft():""}function L(O){let u2=O.match(q);return u2&&u2[0]?O.substring(u2[0].length):O}function Z(O){return R(O).pragmas}function R(O){let u2=(0,m().default)(O)||g().EOL;O=O.replace(S,"").replace(A,"").replace(z,"$1");let h2="";for(;h2!==O;)h2=O,O=O.replace(W,`${u2}$1 $2${u2}`);O=O.replace(k,"").trimRight();let f2=Object.create(null),N2=O.replace($,"").replace(k,"").trimRight(),c2;for(;c2=$.exec(O);){let V2=c2[2].replace(N,"");typeof f2[c2[1]]=="string"||Array.isArray(f2[c2[1]])?f2[c2[1]]=Q.concat(f2[c2[1]],V2):f2[c2[1]]=V2}return{comments:N2,pragmas:f2}}function j(O){let{comments:u2="",pragmas:h2={}}=O,f2=(0,m().default)(u2)||g().EOL,N2="/**",c2=" *",V2=" */",q2=Object.keys(h2),N1=q2.map(d2=>H(d2,h2[d2])).reduce((d2,t1)=>d2.concat(t1),[]).map(d2=>`${c2} ${d2}${f2}`).join("");if(!u2){if(q2.length===0)return"";if(q2.length===1&&!Array.isArray(h2[q2[0]])){let d2=h2[q2[0]];return`${N2} ${H(q2[0],d2)[0]}${V2}`}}let V1=u2.split(f2).map(d2=>`${c2} ${d2}`).join(f2)+f2;return N2+f2+(u2?V1:"")+(u2&&q2.length?c2+f2:"")+N1+V2}function H(O,u2){return Q.concat(u2).map(h2=>`@${O} ${h2}`.trim())}}}),w3=o2({"src/common/end-of-line.js"(a,g){"use strict";n2();function m(q){let N=q.indexOf("\r");return N>=0?q.charAt(N+1)===`
`?"crlf":"cr":"lf"}function f(q){switch(q){case"cr":return"\r";case"crlf":return`\r
`;default:return`
`}}function A(q,N){let k;switch(N){case`
`:k=/\n/g;break;case"\r":k=/\r/g;break;case`\r
`:k=/\r\n/g;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(N)}.`)}let W=q.match(k);return W?W.length:0}function S(q){return q.replace(/\r\n?/g,`
`)}g.exports={guessEndOfLine:m,convertEndOfLineToChars:f,countEndOfLineChars:A,normalizeEndOfLine:S}}}),q3=o2({"src/language-js/utils/get-shebang.js"(a,g){"use strict";n2();function m(f){if(!f.startsWith("#!"))return"";let A=f.indexOf(`
`);return A===-1?f:f.slice(0,A)}g.exports=m}}),B3=o2({"src/language-js/pragma.js"(a,g){"use strict";n2();var{parseWithComments:m,strip:f,extract:A,print:S}=C3(),{normalizeEndOfLine:q}=w3(),N=q3();function k(z){let Q=N(z);Q&&(z=z.slice(Q.length+1));let e2=A(z),{pragmas:L,comments:Z}=m(e2);return{shebang:Q,text:z,pragmas:L,comments:Z}}function W(z){let Q=Object.keys(k(z).pragmas);return Q.includes("prettier")||Q.includes("format")}function $(z){let{shebang:Q,text:e2,pragmas:L,comments:Z}=k(z),R=f(e2),j=S({pragmas:Object.assign({format:""},L),comments:Z.trimStart()});return(Q?`${Q}
`:"")+q(j)+(R.startsWith(`
`)?`
`:`
`)+R}g.exports={hasPragma:W,insertPragma:$}}}),Lt=o2({"src/utils/is-non-empty-array.js"(a,g){"use strict";n2();function m(f){return Array.isArray(f)&&f.length>0}g.exports=m}}),Ot=o2({"src/language-js/loc.js"(a,g){"use strict";n2();var m=Lt();function f(k){var W,$;let z=k.range?k.range[0]:k.start,Q=(W=($=k.declaration)===null||$===void 0?void 0:$.decorators)!==null&&W!==void 0?W:k.decorators;return m(Q)?Math.min(f(Q[0]),z):z}function A(k){return k.range?k.range[1]:k.end}function S(k,W){let $=f(k);return Number.isInteger($)&&$===f(W)}function q(k,W){let $=A(k);return Number.isInteger($)&&$===A(W)}function N(k,W){return S(k,W)&&q(k,W)}g.exports={locStart:f,locEnd:A,hasSameLocStart:S,hasSameLoc:N}}}),S3=o2({"src/language-js/parse/utils/create-parser.js"(a,g){"use strict";n2();var{hasPragma:m}=B3(),{locStart:f,locEnd:A}=Ot();function S(q){return q=typeof q=="function"?{parse:q}:q,Object.assign({astFormat:"estree",hasPragma:m,locStart:f,locEnd:A},q)}g.exports=S}}),F3=o2({"src/language-js/utils/is-ts-keyword-type.js"(a,g){"use strict";n2();function m(f){let{type:A}=f;return A.startsWith("TS")&&A.endsWith("Keyword")}g.exports=m}}),L3=o2({"src/language-js/utils/is-block-comment.js"(a,g){"use strict";n2();var m=new Set(["Block","CommentBlock","MultiLine"]),f=A=>m.has(A==null?void 0:A.type);g.exports=f}}),O3=o2({"src/language-js/utils/is-type-cast-comment.js"(a,g){"use strict";n2();var m=L3();function f(A){return m(A)&&A.value[0]==="*"&&/@(?:type|satisfies)\b/.test(A.value)}g.exports=f}}),T3=o2({"src/utils/get-last.js"(a,g){"use strict";n2();var m=f=>f[f.length-1];g.exports=m}}),Tt=o2({"src/language-js/parse/postprocess/visit-node.js"(a,g){"use strict";n2();function m(f,A){if(Array.isArray(f)){for(let S=0;S<f.length;S++)f[S]=m(f[S],A);return f}if(f&&typeof f=="object"&&typeof f.type=="string"){let S=Object.keys(f);for(let q=0;q<S.length;q++)f[S[q]]=m(f[S[q]],A);return A(f)||f}return f}g.exports=m}}),It=o2({"src/language-js/parse/postprocess/throw-syntax-error.js"(a,g){"use strict";n2();var m=bt();function f(A,S){let{start:q,end:N}=A.loc;throw m(S,{start:{line:q.line,column:q.column+1},end:{line:N.line,column:N.column+1}})}g.exports=f}}),I3=o2({"src/language-js/parse/postprocess/typescript.js"(a,g){"use strict";n2();var m=Lt(),f=Tt(),A=It(),S={AbstractKeyword:126,SourceFile:308,PropertyDeclaration:169};function q($){for(;$&&$.kind!==S.SourceFile;)$=$.parent;return $}function N($){let{illegalDecorators:z}=$;if(!m(z))return;let[{expression:Q}]=z,e2=q(Q),[L,Z]=[Q.pos,Q.end].map(R=>{let{line:j,character:H}=e2.getLineAndCharacterOfPosition(R);return{line:j+1,column:H}});A({loc:{start:L,end:Z}},"Decorators are not valid here.")}function k($,z){$.kind!==S.PropertyDeclaration||$.modifiers&&!$.modifiers.some(Q=>Q.kind===S.AbstractKeyword)||$.initializer&&z.value===null&&A(z,"Abstract property cannot have an initializer")}function W($,z){let{esTreeNodeToTSNodeMap:Q,tsNodeToESTreeNodeMap:e2}=z.tsParseResult;f($,L=>{let Z=Q.get(L);if(!Z)return;let R=e2.get(Z);R===L&&(N(Z),k(Z,R))})}g.exports={throwErrorForInvalidNodes:W}}}),R3=o2({"src/language-js/parse/postprocess/index.js"(a,g){"use strict";n2();var{locStart:m,locEnd:f}=Ot(),A=F3(),S=O3(),q=T3(),N=Tt(),{throwErrorForInvalidNodes:k}=I3(),W=It();function $(L,Z){if(Z.parser==="typescript"&&/@|abstract/.test(Z.originalText)&&k(L,Z),Z.parser!=="typescript"&&Z.parser!=="flow"&&Z.parser!=="acorn"&&Z.parser!=="espree"&&Z.parser!=="meriyah"){let j=new Set;L=N(L,H=>{H.leadingComments&&H.leadingComments.some(S)&&j.add(m(H))}),L=N(L,H=>{if(H.type==="ParenthesizedExpression"){let{expression:O}=H;if(O.type==="TypeCastExpression")return O.range=H.range,O;let u2=m(H);if(!j.has(u2))return O.extra=Object.assign(Object.assign({},O.extra),{},{parenthesized:!0}),O}})}return L=N(L,j=>{switch(j.type){case"ChainExpression":return z(j.expression);case"LogicalExpression":{if(Q(j))return e2(j);break}case"VariableDeclaration":{let H=q(j.declarations);H&&H.init&&R(j,H);break}case"TSParenthesizedType":return A(j.typeAnnotation)||j.typeAnnotation.type==="TSThisType"||(j.typeAnnotation.range=[m(j),f(j)]),j.typeAnnotation;c
`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",T