Son CV dans un terminal web en Javascript! https://terminal-cv.gregandev.fr
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
terminal-cv/node_modules/prettier/parser-meriyah.js

23 lines
238 KiB

!function(e,u){"object"==typeof exports&&"undefined"!=typeof module?module.exports=u():"function"==typeof define&&define.amd?define(u):((e="undefined"!=typeof globalThis?globalThis:e||self).prettierPlugins=e.prettierPlugins||{},e.prettierPlugins.meriyah=u())}(this,(function(){"use strict";var e=function(e,u){const t=new SyntaxError(e+" ("+u.start.line+":"+u.start.column+")");return t.loc=u,t};var u,t=function(...e){let u;for(const[t,n]of e.entries())try{return{result:n()}}catch(e){0===t&&(u=e)}return{error:u}},n=void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function r(){if(void 0===u){var e=new ArrayBuffer(2),t=new Uint8Array(e),n=new Uint16Array(e);if(t[0]=1,t[1]=2,258===n[0])u="BE";else{if(513!==n[0])throw new Error("unable to figure out endianess");u="LE"}}return u}function o(){return void 0!==n.location?n.location.hostname:""}function i(){return[]}function s(){return 0}function a(){return Number.MAX_VALUE}function D(){return Number.MAX_VALUE}function c(){return[]}function l(){return"Browser"}function p(){return void 0!==n.navigator?n.navigator.appVersion:""}function f(){}function d(){}function F(){return"javascript"}function E(){return"browser"}function C(){return"/tmp"}var A=C,g={EOL:"\n",arch:F,platform:E,tmpdir:A,tmpDir:C,networkInterfaces:f,getNetworkInterfaces:d,release:p,type:l,cpus:c,totalmem:D,freemem:a,uptime:s,loadavg:i,hostname:o,endianness:r},m=Object.freeze({__proto__:null,endianness:r,hostname:o,loadavg:i,uptime:s,freemem:a,totalmem:D,cpus:c,type:l,release:p,networkInterfaces:f,getNetworkInterfaces:d,arch:F,platform:E,tmpDir:C,tmpdir:A,EOL:"\n",default:g});const h=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");const u=e.match(/(?:\r?\n)/g)||[];if(0===u.length)return;const t=u.filter((e=>"\r\n"===e)).length;return t>u.length-t?"\r\n":"\n"};var y=h;y.graceful=e=>"string"==typeof e&&h(e)||"\n";var B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function k(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function b(e){var u={exports:{}};return e(u,u.exports),u.exports}var P=k(m),x=function(e){const u=e.match(R);return u?u[0].trimLeft():""},v=function(e){const u=e.match(R);return u&&u[0]?e.substring(u[0].length):e},w=function(e){return G(e).pragmas},S=G,T=function({comments:e="",pragmas:u={}}){const t=(0,I().default)(e)||N().EOL,n=" *",r=Object.keys(u),o=r.map((e=>_(e,u[e]))).reduce(((e,u)=>e.concat(u)),[]).map((e=>" * "+e+t)).join("");if(!e){if(0===r.length)return"";if(1===r.length&&!Array.isArray(u[r[0]])){const e=u[r[0]];return`/** ${_(r[0],e)[0]} */`}}const i=e.split(t).map((e=>` * ${e}`)).join(t)+t;return"/**"+t+(e?i:"")+(e&&r.length?n+t:"")+o+" */"};function N(){const e=P;return N=function(){return e},e}function I(){const e=(u=y)&&u.__esModule?u:{default:u};var u;return I=function(){return e},e}const L=/\*\/$/,O=/^\/\*\*/,R=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,q=/(^|\s+)\/\/([^\r\n]*)/g,j=/^(\r?\n)+/,V=/(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *(?![^@\r\n]*\/\/[^]*)([^@\r\n\s][^@\r\n]+?) *\r?\n/g,M=/(?:^|\r?\n) *@(\S+) *([^\r\n]*)/g,$=/(\r?\n|^) *\* ?/g,U=[];function G(e){const u=(0,I().default)(e)||N().EOL;e=e.replace(O,"").replace(L,"").replace($,"$1");let t="";for(;t!==e;)t=e,e=e.replace(V,`${u}$1 $2${u}`);e=e.replace(j,"").trimRight();const n=Object.create(null),r=e.replace(M,"").replace(j,"").trimRight();let o;for(;o=M.exec(e);){const e=o[2].replace(q,"");"string"==typeof n[o[1]]||Array.isArray(n[o[1]])?n[o[1]]=U.concat(n[o[1]],e):n[o[1]]=e}return{comments:r,pragmas:n}}function _(e,u){return U.concat(u).map((u=>`@${e} ${u}`.trim()))}var X=Object.defineProperty({extract:x,strip:v,parse:w,parseWithComments:S,print:T},"__esModule",{value:!0}),H=e=>"string"==typeof e?e.replace((({onlyFirst:e=!1}={})=>{const u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(u,e?void 0:"g")})(),""):e;const z=e=>!Number.isNaN(e
Print (to stderr) where a cursor at the given position would move to after formatting.
This option cannot be used with --range-start and --range-end.
`,cliCategory:hn},endOfLine:{since:"1.15.0",category:Bn,type:"choice",default:[{since:"1.15.0",value:"auto"},{since:"2.0.0",value:"lf"}],description:"Which end of line characters to apply.",choices:[{value:"lf",description:"Line Feed only (\\n), common on Linux and macOS as well as inside git repos"},{value:"crlf",description:"Carriage Return + Line Feed characters (\\r\\n), common on Windows"},{value:"cr",description:"Carriage Return character only (\\r), used very rarely"},{value:"auto",description:gn`
Maintain existing
(mixed values within one file are normalised by looking at what's used after the first line)
`}]},filepath:{since:"1.4.0",category:kn,type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:yn,cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{since:"1.8.0",category:kn,type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:yn},parser:{since:"0.0.10",category:Bn,type:"choice",default:[{since:"0.0.10",value:"babylon"},{since:"1.13.0",value:void 0}],description:"Which parser to use.",exception:e=>"string"==typeof e||"function"==typeof e,choices:[{value:"flow",description:"Flow"},{value:"babel",since:"1.16.0",description:"JavaScript"},{value:"babel-flow",since:"1.16.0",description:"Flow"},{value:"babel-ts",since:"2.0.0",description:"TypeScript"},{value:"typescript",since:"1.4.0",description:"TypeScript"},{value:"espree",since:"2.2.0",description:"JavaScript"},{value:"meriyah",since:"2.2.0",description:"JavaScript"},{value:"css",since:"1.7.1",description:"CSS"},{value:"less",since:"1.7.1",description:"Less"},{value:"scss",since:"1.7.1",description:"SCSS"},{value:"json",since:"1.5.0",description:"JSON"},{value:"json5",since:"1.13.0",description:"JSON5"},{value:"json-stringify",since:"1.13.0",description:"JSON.stringify"},{value:"graphql",since:"1.5.0",description:"GraphQL"},{value:"markdown",since:"1.8.0",description:"Markdown"},{value:"mdx",since:"1.15.0",description:"MDX"},{value:"vue",since:"1.10.0",description:"Vue"},{value:"yaml",since:"1.14.0",description:"YAML"},{value:"glimmer",since:"2.3.0",description:"Ember / Handlebars"},{value:"html",since:"1.15.0",description:"HTML"},{value:"angular",since:"1.15.0",description:"Angular"},{value:"lwc",since:"1.17.0",description:"Lightning Web Components"}]},plugins:{since:"1.10.0",type:"path",array:!0,default:[{value:[]}],category:Bn,description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>"string"==typeof e||"object"==typeof e,cliName:"plugin",cliCategory:mn},pluginSearchDirs:{since:"1.13.0",type:"path",array:!0,default:[{value:[]}],category:Bn,description:gn`
Custom directory that contains prettier plugins in node_modules subdirectory.
Overrides default behavior when plugins are searched relatively to the location of Prettier.
Multiple values are accepted.
`,exception:e=>"string"==typeof e||"object"==typeof e,cliName:"plugin-search-dir",cliCategory:mn},printWidth:{since:"0.0.0",category:Bn,type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:Number.POSITIVE_INFINITY,step:1}},rangeEnd:{since:"1.4.0",category:kn,type:"int",default:Number.POSITIVE_INFINITY,range:{start:0,end:Number.POSITIVE_INFINITY,step:1},description:gn`
Format code ending at a given character offset (exclusive).
The range will extend forwards to the end of the selected statement.
This option cannot be used with --cursor-offset.
`,cliCategory:hn},rangeStart:{since:"1.4.0",category:kn,type:"int",default:0,range:{start:0,end:Number.POSITIVE_INFINITY,step:1},description:gn`
Format code starting at a given character offset.
The range will extend backwards to the start of the first line containing the selected statement.
This option cannot be used with --cursor-offset.
`,cliCategory:hn},requirePragma:{since:"1.7.0",category:kn,type:"boolean",default:!1,description:gn`
Require either '@prettier' or '@format' to be present in the file's first docblock comment
in order for it to be formatted.
`,cliCategory:yn},tabWidth:{type:"int",category:Bn,default:2,description:"Number of spaces per indentation level.",range:{start:0,end:Number.POSITIVE_INFINITY,step:1}},useTabs:{since:"1.0.0",category:Bn,type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{since:"2.1.0",category:Bn,type:"choice",default:[{since:"2.1.0",value:"auto"}],description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};const Pn=["cliName","cliCategory","cliDescription"],xn={compare:Fn,lt:En,gte:Cn},vn="2.4.1",wn={CATEGORY_CONFIG:mn,CATEGORY_EDITOR:hn,CATEGORY_FORMAT:"Format",CATEGORY_OTHER:yn,CATEGORY_OUTPUT:"Output",CATEGORY_GLOBAL:Bn,CATEGORY_SPECIAL:kn,options:bn}.options;var Sn={getSupportInfo:function({plugins:e=[],showUnreleased:u=!1,showDeprecated:t=!1,showInternal:n=!1}={}){const r=vn.split("-",1)[0],o=e.flatMap((e=>e.languages||[])).filter(D),i=(s=Object.assign({},...e.map((({options:e})=>e)),wn),a="name",Object.entries(s).map((([e,u])=>Object.assign({[a]:e},u)))).filter((e=>D(e)&&c(e))).sort(((e,u)=>e.name===u.name?0:e.name<u.name?-1:1)).map((function(e){if(n)return e;return ue(e,Pn)})).map((u=>{u=Object.assign({},u),Array.isArray(u.default)&&(u.default=1===u.default.length?u.default[0].value:u.default.filter(D).sort(((e,u)=>xn.compare(u.since,e.since)))[0].value),Array.isArray(u.choices)&&(u.choices=u.choices.filter((e=>D(e)&&c(e))),"parser"===u.name&&function(e,u,t){const n=new Set(e.choices.map((e=>e.value)));for(const r of u)if(r.parsers)for(const u of r.parsers)if(!n.has(u)){n.add(u);const o=t.find((e=>e.parsers&&e.parsers[u]));let i=r.name;o&&o.name&&(i+=` (plugin: ${o.name})`),e.choices.push({value:u,description:i})}}(u,o,e));const t=Object.fromEntries(e.filter((e=>e.defaultOptions&&void 0!==e.defaultOptions[u.name])).map((e=>[e.name,e.defaultOptions[u.name]])));return Object.assign(Object.assign({},u),{},{pluginDefaults:t})}));var s,a;return{languages:o,options:i};function D(e){return u||!("since"in e)||e.since&&xn.gte(r,e.since)}function c(e){return t||!("deprecated"in e)||e.deprecated&&xn.lt(r,e.deprecated)}}};const{getSupportInfo:Tn}=Sn,Nn=/[^\x20-\x7F]/;function In(e){return(u,t,n)=>{const r=n&&n.backwards;if(!1===t)return!1;const{length:o}=u;let i=t;for(;i>=0&&i<o;){const t=u.charAt(i);if(e instanceof RegExp){if(!e.test(t))return i}else if(!e.includes(t))return i;r?i--:i++}return(-1===i||i===o)&&i}}const Ln=In(/\s/),On=In(" \t"),Rn=In(",; \t"),qn=In(/[^\n\r]/);function jn(e,u){if(!1===u)return!1;if("/"===e.charAt(u)&&"*"===e.charAt(u+1))for(let t=u+2;t<e.length;++t)if("*"===e.charAt(t)&&"/"===e.charAt(t+1))return t+2;return u}function Vn(e,u){return!1!==u&&("/"===e.charAt(u)&&"/"===e.charAt(u+1)?qn(e,u):u)}function Mn(e,u,t){const n=t&&t.backwards;if(!1===u)return!1;const r=e.charAt(u);if(n){if("\r"===e.charAt(u-1)&&"\n"===r)return u-2;if("\n"===r||"\r"===r||"\u2028"===r||"\u2029"===r)return u-1}else{if("\r"===r&&"\n"===e.charAt(u+1))return u+2;if("\n"===r||"\r"===r||"\u2028"===r||"\u2029"===r)return u+1}return u}function $n(e,u,t={}){const n=On(e,t.backwards?u-1:u,t);return n!==Mn(e,n,t)}function Un(e,u){let t=null,n=u;for(;n!==t;)t=n,n=Rn(e,n),n=jn(e,n),n=On(e,n);return n=Vn(e,n),n=Mn(e,n),!1!==n&&$n(e,n)}function Gn(e,u){let t=null,n=u;for(;n!==t;)t=n,n=On(e,n),n=jn(e,n),n=Vn(e,n),n=Mn(e,n);return n}function _n(e,u,t){return Gn(e,t(u))}function Xn(e,u,t=0){let n=0;for(let r=t;r<e.length;++r)"\t"===e[r]?n=n+u-n%u:n++;return n}function Hn(e,u){const t=e.slice(1,-1),n={quote:'"',regex:/"/g},r={quote:"'",regex:/'/g},o="'"===u?r:n,i=o===r?n:r;let s=o.quote;if(t.includes(o.quote)||t.includes(i.quote)){s=(t.match(o.regex)||[]).length>(t.match(i.regex)||[]).length?i.quote:o.quote}return s}function zn(e,u,t){const n='"'===u?"'":'"',r=e.replace(/\\(.)|(["'])/gs,((e,r,o)=>r===n?r:o===u?"\\"+o:o||(t&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/.test(r)?r:"\\"+r)));return u+r+u}function Jn(e,u){(e