wrangler-action/node_modules/prettier/plugins/meriyah.mjs

6 lines
117 KiB
JavaScript
Raw Normal View History

2023-08-07 22:11:15 +02:00
var Nu=Object.create;var G2=Object.defineProperty;var Vu=Object.getOwnPropertyDescriptor;var Ru=Object.getOwnPropertyNames;var Ou=Object.getPrototypeOf,Uu=Object.prototype.hasOwnProperty;var Mu=(e,u)=>()=>(u||e((u={exports:{}}).exports,u),u.exports),Se=(e,u)=>{for(var n in u)G2(e,n,{get:u[n],enumerable:!0})},Ju=(e,u,n,i)=>{if(u&&typeof u=="object"||typeof u=="function")for(let t of Ru(u))!Uu.call(e,t)&&t!==n&&G2(e,t,{get:()=>u[t],enumerable:!(i=Vu(u,t))||i.enumerable});return e};var ju=(e,u,n)=>(n=e!=null?Nu(Ou(e)):{},Ju(u||!e||!e.__esModule?G2(n,"default",{value:e,enumerable:!0}):n,e));var Cu=Mu(a2=>{"use strict";Object.defineProperty(a2,"__esModule",{value:!0});a2.extract=A0;a2.parse=P0;a2.parseWithComments=Au;a2.print=E0;a2.strip=C0;var y0=/\*\/$/,k0=/^\/\*\*?/,Du=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,h0=/(^|\s+)\/\/([^\r\n]*)/g,yu=/^(\r?\n)+/,D0=/(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *(?![^@\r\n]*\/\/[^]*)([^@\r\n\s][^@\r\n]+?) *\r?\n/g,ku=/(?:^|\r?\n) *@(\S+) *([^\r\n]*)/g,b0=/(\r?\n|^) *\* ?/g,bu=[];function A0(e){let u=e.match(Du);return u?u[0].trimLeft():""}function C0(e){let u=e.match(Du);return u&&u[0]?e.substring(u[0].length):e}function P0(e){return Au(e).pragmas}function Au(e){let u=`
`;e=e.replace(k0,"").replace(y0,"").replace(b0,"$1");let n="";for(;n!==e;)n=e,e=e.replace(D0,`${u}$1 $2${u}`);e=e.replace(yu,"").trimRight();let i=Object.create(null),t=e.replace(ku,"").replace(yu,"").trimRight(),o;for(;o=ku.exec(e);){let l=o[2].replace(h0,"");typeof i[o[1]]=="string"||Array.isArray(i[o[1]])?i[o[1]]=bu.concat(i[o[1]],l):i[o[1]]=l}return{comments:t,pragmas:i}}function E0({comments:e="",pragmas:u={}}){let n=`
`,i="/**",t=" *",o=" */",l=Object.keys(u),f=l.map(a=>hu(a,u[a])).reduce((a,g)=>a.concat(g),[]).map(a=>`${t} ${a}${n}`).join("");if(!e){if(l.length===0)return"";if(l.length===1&&!Array.isArray(u[l[0]])){let a=u[l[0]];return`${i} ${hu(l[0],a)[0]}${o}`}}let c=e.split(n).map(a=>`${t} ${a}`).join(n)+n;return i+n+(e?c:"")+(e&&l.length?t+n:"")+f+o}function hu(e,u){return bu.concat(u).map(n=>`@${e} ${n}`.trim())}});var we={};Se(we,{parsers:()=>Z2});var Z2={};Se(Z2,{meriyah:()=>H0});var Xu={0:"Unexpected token",28:"Unexpected token: '%0'",1:"Octal escape sequences are not allowed in strict mode",2:"Octal escape sequences are not allowed in template strings",3:"Unexpected token `#`",4:"Illegal Unicode escape sequence",5:"Invalid code point %0",6:"Invalid hexadecimal escape sequence",8:"Octal literals are not allowed in strict mode",7:"Decimal integer literals with a leading zero are forbidden in strict mode",9:"Expected number in radix %0",146:"Invalid left-hand side assignment to a destructible right-hand side",10:"Non-number found after exponent indicator",11:"Invalid BigIntLiteral",12:"No identifiers allowed directly after numeric literal",13:"Escapes \\8 or \\9 are not syntactically valid escapes",14:"Unterminated string literal",15:"Unterminated template literal",16:"Multiline comment was not closed properly",17:"The identifier contained dynamic unicode escape that was not closed",18:"Illegal character '%0'",19:"Missing hexadecimal digits",20:"Invalid implicit octal",21:"Invalid line break in string literal",22:"Only unicode escapes are legal in identifier names",23:"Expected '%0'",24:"Invalid left-hand side in assignment",25:"Invalid left-hand side in async arrow",26:'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass',27:"Member access on super must be in a method",29:"Await expression not allowed in formal parameter",30:"Yield expression not allowed in formal parameter",93:"Unexpected token: 'escaped keyword'",31:"Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses",120:"Async functions can only be declared at the top level or inside a block",32:"Unterminated regular expression",33:"Unexpected regular expression flag",34:"Duplicate regular expression flag '%0'",35:"%0 functions must have exactly %1 argument%2",36:"Setter function argument must not be a rest parameter",37:"%0 declaration must have a name in this context",38:"Function name may not contain any reserved words or be eval or arguments in strict mode",39:"The rest operator is missing an argument",40:"A getter cannot be a generator",41:"A setter cannot be a generator",42:"A computed property name must be followed by a colon or paren",131:"Object literal keys that are strings or numbers must be a method or have a colon",44:"Found `* async x(){}` but this should be `async * x(){}`",43:"Getters and setters can not be generators",45:"'%0' can not be generator method",46:"No line break is allowed after '=>'",47:"The left-hand side of the arrow can only be destructed through assignment",48:"The binding declaration is not destructible",49:"Async arrow can not be followed by new expression",50:"Classes may not have a static property named 'prototype'",51:"Class constructor may not be a %0",52:"Duplicate constructor method in class",53:"Invalid increment/decrement operand",54:"Invalid use of `new` keyword on an increment/decrement expression",55:"`=>` is an invalid assignment target",56:"Rest element may not have a trailing comma",57:"Missing initializer in %0 declaration",58:"'for-%0' loop head declarations can not have an initializer",59:"Invalid left-hand side in for-%0 loop: Must have a single binding",60:"Invalid shorthand property initializer",61:"Property name __proto__ appears more than once in object literal",62:"Let is disallowed as a lexically bound name",63:"Invalid use of '%0' inside new expression",64:"Illegal 'use strict' directive in function with non-simple parameter list",65:'Identifier "let" disallowed as left-hand side expression in
`);return u===-1?e:e.slice(0,u)}var Pu=w0;function S0(e){let u=Pu(e);u&&(e=e.slice(u.length+1));let n=(0,C2.extract)(e),{pragmas:i,comments:t}=(0,C2.parseWithComments)(n);return{shebang:u,text:e,pragmas:i,comments:t}}function Eu(e){let{pragmas:u}=S0(e);return Object.prototype.hasOwnProperty.call(u,"prettier")||Object.prototype.hasOwnProperty.call(u,"format")}function v0(e){return Array.isArray(e)&&e.length>0}var T2=v0;function $(e){var i;let u=e.range?e.range[0]:e.start,n=((i=e.declaration)==null?void 0:i.decorators)??e.decorators;return T2(n)?Math.min($(n[0]),u):u}function p(e){return e.range?e.range[1]:e.end}function B0(e){return e=typeof e=="function"?{parse:e}:e,{astFormat:"estree",hasPragma:Eu,locStart:$,locEnd:p,...e}}var wu=B0;var T0=(e,u,n)=>{if(!(e&&u==null))return Array.isArray(u)||typeof u=="string"?u[n<0?u.length+n:n]:u.at(n)},be=T0;function F0(e){return e=new Set(e),u=>e.has(u==null?void 0:u.type)}var Su=F0;var q0=Su(["Block","CommentBlock","MultiLine"]),F2=q0;function L0(e){return F2(e)&&e.value[0]==="*"&&/@(?:type|satisfies)\b/.test(e.value)}var vu=L0;function I0(e){let u=`*${e.value}*`.split(`
`);return u.length>1&&u.every(n=>n.trimStart()[0]==="*")}var Ae=I0;var q2=null;function L2(e){if(q2!==null&&typeof q2.property){let u=q2;return q2=L2.prototype=null,u}return q2=L2.prototype=e??Object.create(null),new L2}var N0=10;for(let e=0;e<=N0;e++)L2();function Ce(e){return L2(e)}function V0(e,u="type"){Ce(e);function n(i){let t=i[u],o=e[t];if(!Array.isArray(o))throw Object.assign(new Error(`Missing visitor keys for '${t}'.`),{node:i});return o}return n}var Bu=V0;var Tu={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["test","body"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body","returnType","typeParameters","predicate"],FunctionExpression:["id","params","body","returnType","typeParameters"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["params","body","returnType","typeParameters","predicate"],ClassBody:["body"],ClassExpression:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],ClassDeclaration:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],ExportAllDeclaration:["source","attributes","assertions","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes","assertions"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes","assertions"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["local","imported"],MetaProperty:["meta","property"],ClassMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","quasi","typeParameters"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],Import:[],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["key","value","typeAnnotation","decorators","variance"],ClassAccessorProperty:["key","value","typeAnnotation","decorators"],ClassPrivateProperty:["key","value","decorators","typeAnnotation","variance"],ClassPrivateMethod:["key","params","body","decorators","returnType","typeParameters"],Priv