index.js 2.6 KB
module.exports=(()=>{"use strict";var e={486:(e,r,t)=>{const n=t(622);const s=t(447);e.exports=((e,r={})=>{const t=n.resolve(r.cwd||"");const{root:c}=n.parse(t);const o=[].concat(e);return new Promise(e=>{(function find(r){s(o,{cwd:r}).then(t=>{if(t){e(n.join(r,t))}else if(r===c){e(null)}else{find(n.dirname(r))}})})(t)})});e.exports.sync=((e,r={})=>{let t=n.resolve(r.cwd||"");const{root:c}=n.parse(t);const o=[].concat(e);while(true){const e=s.sync(o,{cwd:t});if(e){return n.join(t,e)}if(t===c){return null}t=n.dirname(t)}})},447:(e,r,t)=>{const n=t(622);const s=t(978);const c=t(104);e.exports=((e,r)=>{r=Object.assign({cwd:process.cwd()},r);return c(e,e=>s(n.resolve(r.cwd,e)),r)});e.exports.sync=((e,r)=>{r=Object.assign({cwd:process.cwd()},r);for(const t of e){if(s.sync(n.resolve(r.cwd,t))){return t}}})},684:(e,r,t)=>{const n=t(746);const s=e=>{if(!((Number.isInteger(e)||e===Infinity)&&e>0)){return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"))}const r=[];let t=0;const s=()=>{t--;if(r.length>0){r.shift()()}};const c=(e,r,...c)=>{t++;const o=n(e,...c);r(o);o.then(s,s)};const o=(n,s,...o)=>{if(t<e){c(n,s,...o)}else{r.push(c.bind(null,n,s,...o))}};const i=(e,...r)=>new Promise(t=>o(e,t,...r));Object.defineProperties(i,{activeCount:{get:()=>t},pendingCount:{get:()=>r.length},clearQueue:{value:()=>{r.length=0}}});return i};e.exports=s;e.exports.default=s},104:(e,r,t)=>{const n=t(684);class EndError extends Error{constructor(e){super();this.value=e}}const s=(e,r)=>Promise.resolve(e).then(r);const c=e=>Promise.all(e).then(e=>e[1]===true&&Promise.reject(new EndError(e[0])));e.exports=((e,r,t)=>{t=Object.assign({concurrency:Infinity,preserveOrder:true},t);const o=n(t.concurrency);const i=[...e].map(e=>[e,o(s,e,r)]);const u=n(t.preserveOrder?1:Infinity);return Promise.all(i.map(e=>u(c,e))).then(()=>{}).catch(e=>e instanceof EndError?e.value:Promise.reject(e))})},746:e=>{const r=(e,...r)=>new Promise(t=>{t(e(...r))});e.exports=r;e.exports.default=r},978:(e,r,t)=>{const n=t(747);e.exports=(e=>new Promise(r=>{n.access(e,e=>{r(!e)})}));e.exports.sync=(e=>{try{n.accessSync(e);return true}catch(e){return false}})},586:(e,r,t)=>{const n=t(486);e.exports=(async({cwd:e}={})=>n("package.json",{cwd:e}));e.exports.sync=(({cwd:e}={})=>n.sync("package.json",{cwd:e}))},747:e=>{e.exports=require("fs")},622:e=>{e.exports=require("path")}};var r={};function __nccwpck_require__(t){if(r[t]){return r[t].exports}var n=r[t]={exports:{}};var s=true;try{e[t](n,n.exports,__nccwpck_require__);s=false}finally{if(s)delete r[t]}return n.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(586)})();