github-pages-deploy-action/node_modules/prettier/parser-babel.js

2 lines
288 KiB
JavaScript
Raw Permalink Normal View History

2020-09-28 02:40:17 +08:00
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):((t="undefined"!=typeof globalThis?globalThis:t||self).prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.babel=e())}(this,(function(){"use strict";var t=function(t,e){const s=new SyntaxError(t+" ("+e.start.line+":"+e.start.column+")");return s.loc=e,s};function e(t,e,s){return t(s={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&s.path)}},s.exports),s.exports}function s(t){return t&&t.default||t}var i=Object.freeze({__proto__:null,default:{EOL:"\n"}});const r=t=>{if("string"!=typeof t)throw new TypeError("Expected a string");const e=t.match(/(?:\r?\n)/g)||[];if(0===e.length)return;const s=e.filter(t=>"\r\n"===t).length;return s>e.length-s?"\r\n":"\n"};var a=r;a.graceful=t=>"string"==typeof t&&r(t)||"\n";var n=s(i),o=e((function(t,e){function s(){const t=n;return s=function(){return t},t}function i(){const t=(e=a)&&e.__esModule?e:{default:e};var e;return i=function(){return t},t}Object.defineProperty(e,"__esModule",{value:!0}),e.extract=function(t){const e=t.match(h);return e?e[0].trimLeft():""},e.strip=function(t){const e=t.match(h);return e&&e[0]?t.substring(e[0].length):t},e.parse=function(t){return f(t).pragmas},e.parseWithComments=f,e.print=function({comments:t="",pragmas:e={}}){const r=(0,i().default)(t)||s().EOL,a=Object.keys(e),n=a.map(t=>D(t,e[t])).reduce((t,e)=>t.concat(e),[]).map(t=>" * "+t+r).join("");if(!t){if(0===a.length)return"";if(1===a.length&&!Array.isArray(e[a[0]])){const t=e[a[0]];return"".concat("/**"," ").concat(D(a[0],t)[0]).concat(" */")}}const o=t.split(r).map(t=>"".concat(" *"," ").concat(t)).join(r)+r;return"/**"+r+(t?o:"")+(t&&a.length?" *"+r:"")+n+" */"};const r=/\*\/$/,o=/^\/\*\*/,h=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,c=/(^|\s+)\/\/([^\r\n]*)/g,p=/^(\r?\n)+/,u=/(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *(?![^@\r\n]*\/\/[^]*)([^@\r\n\s][^@\r\n]+?) *\r?\n/g,l=/(?:^|\r?\n) *@(\S+) *([^\r\n]*)/g,d=/(\r?\n|^) *\* ?/g,m=[];function f(t){const e=(0,i().default)(t)||s().EOL;t=t.replace(o,"").replace(r,"").replace(d,"$1");let a="";for(;a!==t;)a=t,t=t.replace(u,"".concat(e,"$1 $2").concat(e));t=t.replace(p,"").trimRight();const n=Object.create(null),h=t.replace(l,"").replace(p,"").trimRight();let f;for(;f=l.exec(t);){const t=f[2].replace(c,"");"string"==typeof n[f[1]]||Array.isArray(n[f[1]])?n[f[1]]=m.concat(n[f[1]],t):n[f[1]]=t}return{comments:h,pragmas:n}}function D(t,e){return m.concat(e).map(e=>"@".concat(t," ").concat(e).trim())}})),h=t=>"string"==typeof t?t.replace((({onlyFirst:t=!1}={})=>{const e=["[\\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(e,t?void 0:"g")})(),""):t;const c=t=>!Number.isNaN(t)&&(t>=4352&&(t<=4447||9001===t||9002===t||11904<=t&&t<=12871&&12351!==t||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141));var p=c,u=c;p.default=u;const l=t=>{if("string"!=typeof(t=t.replace(/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDD