diff --git a/node.js/dist/cli.min.js b/node.js/dist/cli.min.js index 94fbf4c..a1b2c2b 100644 --- a/node.js/dist/cli.min.js +++ b/node.js/dist/cli.min.js @@ -4,7 +4,7 @@ * Source: https://code.minify-js.org/node.js * Documentation: https://docs.minify-js.org/node.js */ -let pkgName="@adamlui/minify.js",copyright="© 2024 Adam Lui & contributors under the MIT license.",cmdFormat="minify-js [inputPath] [outputPath] [options]",srcURL="https://code.minify-js.org/node.js",docURL="https://docs.minify-js.org/node.js/#-command-line-usage";(async()=>{let r=require(__dirname.match(/src/)?"./minify":"./minify.min"),t=require("fs"),l=require("path"),i=require("node-clipboardy"),o=require("child_process").execSync,a="",c="",m="",f="",d="",p="en";if("win32"==process.platform)try{p=o("(Get-Culture).TwoLetterISOLanguageName",{shell:"powershell",encoding:"utf-8"}).trim()}catch(e){}else{var g=process.env;p=(g.LANG||g.LANGUAGE||g.LC_ALL||g.LC_MESSAGES||g.LC_NAME||"en").split(".")[0]}let h={};g=new Promise((s,r)=>{let t="https://cdn.jsdelivr.net/gh/adamlui/minify.js@dcb54b5f09ff44d9b68431328b7baaa7240a4a9e/_locales/",e=(p?p.replace("-","_"):"en")+"/",l=t+e+"messages.json",a=0;$(l).then(async function i(o){try{let e=await o.json(),i={};for(var n in e)"object"==typeof e[n]&&"message"in e[n]&&(i[n]=e[n].message);s(i)}catch(e){if(3==++a)return s({});$(l=p.includes("-")&&1==a?l.replace(/([^_]*)_[^/]*(\/.*)/,"$1$2"):t+"en/messages.json").then(i).catch(r)}}).catch(r)});try{h=await g}catch(e){}let u={},s={flags:{dryRun:/^--?(?:n|dry-?run)$/,includeDotFolders:/^--?(?:dd?|(?:include-?)?dot-?(?:folder|dir(?:ector(?:y|ie))?)s?=?(?:true|1)?)$/,includeDotFiles:/^--?(?:df|D|(?:include-?)?dot-?files?=?(?:true|1)?)$/,noRecursion:/^--?(?:R|(?:disable|no)-?recursi(?:on|ve)|recursi(?:on|ve)=(?:false|0))$/,noMangle:/^--?(?:M|(?:disable|no)-?mangle|mangle=(?:false|0))$/,noFilenameChange:/^--?(?:X|(?:disable|no)-?(?:file)?name-?change|(?:file)?name-?change=(?:false|0))$/,copy:/^--?c(?:opy)?$/,quietMode:/^--?q(?:uiet)?(?:-?mode)?$/},paramOptions:{ignoreFiles:/^--?(?:ignore|skip|exclude)(?:d?-?files?)?(?:=.*|$)/,comment:/^--?comments?(?:=.*|$)/},infoCmds:{help:/^--?h(?:elp)?$/,version:/^--?ve?r?s?i?o?n?$/}};if(process.argv.forEach(i=>{var e,o,n;i.startsWith("-")&&(n=Object.keys(s.flags).find(e=>s.flags[e].test(i)),e=Object.keys(s.paramOptions).find(e=>s.paramOptions[e].test(i)),o=Object.keys(s.infoCmds).find(e=>s.infoCmds[e].test(i)),n?u[n]=!0:e?(/=.+/.test(i)||(console.error(` +let pkgName="@adamlui/minify.js",copyright="© 2024 Adam Lui & contributors under the MIT license.",cmdFormat="minify-js [inputPath] [outputPath] [options]",srcURL="https://code.minify-js.org/node.js",docURL="https://docs.minify-js.org/node.js/#-command-line-usage";(async()=>{let r=require(__dirname.match(/src/)?"./minify":"./minify.min"),t=require("fs"),l=require("path"),i=require("node-clipboardy"),o=require("child_process").execSync,a="",c="",m="",f="",d="",p="en";if("win32"==process.platform)try{p=o("(Get-Culture).TwoLetterISOLanguageName",{shell:"powershell",encoding:"utf-8"}).trim()}catch(e){}else{var g=process.env;p=(g.LANG||g.LANGUAGE||g.LC_ALL||g.LC_MESSAGES||g.LC_NAME||"en").split(".")[0]}let h={};g=new Promise((s,r)=>{let t="https://cdn.jsdelivr.net/gh/adamlui/minify.js@7e9028a25e4e1f4b375b75ff81c98763eafec73d/_locales/",e=(p?p.replace("-","_"):"en")+"/",l=t+e+"messages.json",a=0;$(l).then(async function i(o){try{let e=await o.json(),i={};for(var n in e)"object"==typeof e[n]&&"message"in e[n]&&(i[n]=e[n].message);s(i)}catch(e){if(3==++a)return s({});$(l=p.includes("-")&&1==a?l.replace(/([^_]*)_[^/]*(\/.*)/,"$1$2"):t+"en/messages.json").then(i).catch(r)}}).catch(r)});try{h=await g}catch(e){}let u={},s={flags:{dryRun:/^--?(?:n|dry-?run)$/,includeDotFolders:/^--?(?:dd?|(?:include-?)?dot-?(?:folder|dir(?:ector(?:y|ie))?)s?=?(?:true|1)?)$/,includeDotFiles:/^--?(?:df|D|(?:include-?)?dot-?files?=?(?:true|1)?)$/,noRecursion:/^--?(?:R|(?:disable|no)-?recursi(?:on|ve)|recursi(?:on|ve)=(?:false|0))$/,noMangle:/^--?(?:M|(?:disable|no)-?mangle|mangle=(?:false|0))$/,noFilenameChange:/^--?(?:X|(?:disable|no)-?(?:file)?name-?change|(?:file)?name-?change=(?:false|0))$/,copy:/^--?c(?:opy)?$/,quietMode:/^--?q(?:uiet)?(?:-?mode)?$/},paramOptions:{ignoreFiles:/^--?(?:ignore|skip|exclude)(?:d?-?files?)?(?:=.*|$)/,comment:/^--?comments?(?:=.*|$)/},infoCmds:{help:/^--?h(?:elp)?$/,version:/^--?ve?r?s?i?o?n?$/}};if(process.argv.forEach(i=>{var e,o,n;i.startsWith("-")&&(n=Object.keys(s.flags).find(e=>s.flags[e].test(i)),e=Object.keys(s.paramOptions).find(e=>s.paramOptions[e].test(i)),o=Object.keys(s.infoCmds).find(e=>s.infoCmds[e].test(i)),n?u[n]=!0:e?(/=.+/.test(i)||(console.error(` ${c+(h.prefix_error||"ERROR")}: `+`Arg [--${i.replace(/-/g,"")}] `+`${h.error_noEqual||"requires '=' followed by a value"}.${a}`),_(),process.exit(1)),n=i.split("=")[1],u[e]=parseInt(n)||n):o||(console.error(` ${c+(h.prefix_error||"ERROR")}: `+`Arg [${i}] ${h.error_notRecognized||"not recognized"}.`),console.info(` ${m+(h.info_validArgs||"Valid arguments are below")}.`),y(["flags","paramOptions","infoCmds"]),process.exit(1)))}),process.argv.some(e=>s.infoCmds.help.test(e)))y();else if(process.argv.some(e=>s.infoCmds.version.test(e))){g=o(`npm view ${pkgName} version`).toString().trim()||"none";let e,i=process.cwd();for(;"/"!=i;){var n=l.join(i,"package.json");if(t.existsSync(n)){n=require(n);e=(n.dependencies?.[pkgName]||n.devDependencies?.[pkgName])?.match(/(\d+\.\d+\.\d+)/)[0]||"none";break}i=l.dirname(i)}console.info(`