UNPKG

@modern-js/module-tools

Version:

Simple, powerful, high-performance modern npm package development solution.

1 lines 3.1 kB
(()=>{"use strict";var e={964:(e,r,t)=>{const n=t(841);const o=t(111);const cleanInternalStack=e=>e.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");class AggregateError extends Error{constructor(e){if(!Array.isArray(e)){throw new TypeError(`Expected input to be an Array, got ${typeof e}`)}e=[...e].map((e=>{if(e instanceof Error){return e}if(e!==null&&typeof e==="object"){return Object.assign(new Error(e.message),e)}return new Error(e)}));let r=e.map((e=>typeof e.stack==="string"?cleanInternalStack(o(e.stack)):String(e))).join("\n");r="\n"+n(r,4);super(r);this.name="AggregateError";Object.defineProperty(this,"_errors",{value:e})}*[Symbol.iterator](){for(const e of this._errors){yield e}}}e.exports=AggregateError},111:(e,r,t)=>{const n=t(37);const o=/\s+at.*(?:\(|\s)(.*)\)?/;const s=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/;const i=typeof n.homedir==="undefined"?"":n.homedir();e.exports=(e,r)=>{r=Object.assign({pretty:false},r);return e.replace(/\\/g,"/").split("\n").filter((e=>{const r=e.match(o);if(r===null||!r[1]){return true}const t=r[1];if(t.includes(".app/Contents/Resources/electron.asar")||t.includes(".app/Contents/Resources/default_app.asar")){return false}return!s.test(t)})).filter((e=>e.trim()!=="")).map((e=>{if(r.pretty){return e.replace(o,((e,r)=>e.replace(r,r.replace(i,"~"))))}return e})).join("\n")}},841:e=>{e.exports=(e,r=1,t)=>{t={indent:" ",includeEmptyLines:false,...t};if(typeof e!=="string"){throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``)}if(typeof r!=="number"){throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof r}\``)}if(typeof t.indent!=="string"){throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof t.indent}\``)}if(r===0){return e}const n=t.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,t.indent.repeat(r))}},977:(e,r,t)=>{const n=t(964);e.exports=async(e,r,{concurrency:t=Infinity,stopOnError:o=true}={})=>new Promise(((s,i)=>{if(typeof r!=="function"){throw new TypeError("Mapper function is required")}if(!((Number.isSafeInteger(t)||t===Infinity)&&t>=1)){throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`)}const a=[];const p=[];const c=e[Symbol.iterator]();let f=false;let u=false;let l=0;let y=0;const next=()=>{if(f){return}const e=c.next();const t=y;y++;if(e.done){u=true;if(l===0){if(!o&&p.length!==0){i(new n(p))}else{s(a)}}return}l++;(async()=>{try{const n=await e.value;a[t]=await r(n,t);l--;next()}catch(e){if(o){f=true;i(e)}else{p.push(e);l--;next()}}})()};for(let e=0;e<t;e++){next();if(u){break}}}))},37:e=>{e.exports=require("os")}};var r={};function __nccwpck_require__(t){var n=r[t];if(n!==undefined){return n.exports}var o=r[t]={exports:{}};var s=true;try{e[t](o,o.exports,__nccwpck_require__);s=false}finally{if(s)delete r[t]}return o.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(977);module.exports=t})();