213.index.js 98 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969
  1. exports.id = 213;
  2. exports.ids = [213];
  3. exports.modules = {
  4. /***/ 5623:
  5. /***/ ((module) => {
  6. "use strict";
  7. module.exports = balanced;
  8. function balanced(a, b, str) {
  9. if (a instanceof RegExp) a = maybeMatch(a, str);
  10. if (b instanceof RegExp) b = maybeMatch(b, str);
  11. var r = range(a, b, str);
  12. return r && {
  13. start: r[0],
  14. end: r[1],
  15. pre: str.slice(0, r[0]),
  16. body: str.slice(r[0] + a.length, r[1]),
  17. post: str.slice(r[1] + b.length)
  18. };
  19. }
  20. function maybeMatch(reg, str) {
  21. var m = str.match(reg);
  22. return m ? m[0] : null;
  23. }
  24. balanced.range = range;
  25. function range(a, b, str) {
  26. var begs, beg, left, right, result;
  27. var ai = str.indexOf(a);
  28. var bi = str.indexOf(b, ai + 1);
  29. var i = ai;
  30. if (ai >= 0 && bi > 0) {
  31. if(a===b) {
  32. return [ai, bi];
  33. }
  34. begs = [];
  35. left = str.length;
  36. while (i >= 0 && !result) {
  37. if (i == ai) {
  38. begs.push(i);
  39. ai = str.indexOf(a, i + 1);
  40. } else if (begs.length == 1) {
  41. result = [ begs.pop(), bi ];
  42. } else {
  43. beg = begs.pop();
  44. if (beg < left) {
  45. left = beg;
  46. right = bi;
  47. }
  48. bi = str.indexOf(b, i + 1);
  49. }
  50. i = ai < bi && ai >= 0 ? ai : bi;
  51. }
  52. if (begs.length) {
  53. result = [ left, right ];
  54. }
  55. }
  56. return result;
  57. }
  58. /***/ }),
  59. /***/ 3644:
  60. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  61. var concatMap = __webpack_require__(11048);
  62. var balanced = __webpack_require__(5623);
  63. module.exports = expandTop;
  64. var escSlash = '\0SLASH'+Math.random()+'\0';
  65. var escOpen = '\0OPEN'+Math.random()+'\0';
  66. var escClose = '\0CLOSE'+Math.random()+'\0';
  67. var escComma = '\0COMMA'+Math.random()+'\0';
  68. var escPeriod = '\0PERIOD'+Math.random()+'\0';
  69. function numeric(str) {
  70. return parseInt(str, 10) == str
  71. ? parseInt(str, 10)
  72. : str.charCodeAt(0);
  73. }
  74. function escapeBraces(str) {
  75. return str.split('\\\\').join(escSlash)
  76. .split('\\{').join(escOpen)
  77. .split('\\}').join(escClose)
  78. .split('\\,').join(escComma)
  79. .split('\\.').join(escPeriod);
  80. }
  81. function unescapeBraces(str) {
  82. return str.split(escSlash).join('\\')
  83. .split(escOpen).join('{')
  84. .split(escClose).join('}')
  85. .split(escComma).join(',')
  86. .split(escPeriod).join('.');
  87. }
  88. // Basically just str.split(","), but handling cases
  89. // where we have nested braced sections, which should be
  90. // treated as individual members, like {a,{b,c},d}
  91. function parseCommaParts(str) {
  92. if (!str)
  93. return [''];
  94. var parts = [];
  95. var m = balanced('{', '}', str);
  96. if (!m)
  97. return str.split(',');
  98. var pre = m.pre;
  99. var body = m.body;
  100. var post = m.post;
  101. var p = pre.split(',');
  102. p[p.length-1] += '{' + body + '}';
  103. var postParts = parseCommaParts(post);
  104. if (post.length) {
  105. p[p.length-1] += postParts.shift();
  106. p.push.apply(p, postParts);
  107. }
  108. parts.push.apply(parts, p);
  109. return parts;
  110. }
  111. function expandTop(str) {
  112. if (!str)
  113. return [];
  114. // I don't know why Bash 4.3 does this, but it does.
  115. // Anything starting with {} will have the first two bytes preserved
  116. // but *only* at the top level, so {},a}b will not expand to anything,
  117. // but a{},b}c will be expanded to [a}c,abc].
  118. // One could argue that this is a bug in Bash, but since the goal of
  119. // this module is to match Bash's rules, we escape a leading {}
  120. if (str.substr(0, 2) === '{}') {
  121. str = '\\{\\}' + str.substr(2);
  122. }
  123. return expand(escapeBraces(str), true).map(unescapeBraces);
  124. }
  125. function identity(e) {
  126. return e;
  127. }
  128. function embrace(str) {
  129. return '{' + str + '}';
  130. }
  131. function isPadded(el) {
  132. return /^-?0\d/.test(el);
  133. }
  134. function lte(i, y) {
  135. return i <= y;
  136. }
  137. function gte(i, y) {
  138. return i >= y;
  139. }
  140. function expand(str, isTop) {
  141. var expansions = [];
  142. var m = balanced('{', '}', str);
  143. if (!m || /\$$/.test(m.pre)) return [str];
  144. var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
  145. var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
  146. var isSequence = isNumericSequence || isAlphaSequence;
  147. var isOptions = m.body.indexOf(',') >= 0;
  148. if (!isSequence && !isOptions) {
  149. // {a},b}
  150. if (m.post.match(/,.*\}/)) {
  151. str = m.pre + '{' + m.body + escClose + m.post;
  152. return expand(str);
  153. }
  154. return [str];
  155. }
  156. var n;
  157. if (isSequence) {
  158. n = m.body.split(/\.\./);
  159. } else {
  160. n = parseCommaParts(m.body);
  161. if (n.length === 1) {
  162. // x{{a,b}}y ==> x{a}y x{b}y
  163. n = expand(n[0], false).map(embrace);
  164. if (n.length === 1) {
  165. var post = m.post.length
  166. ? expand(m.post, false)
  167. : [''];
  168. return post.map(function(p) {
  169. return m.pre + n[0] + p;
  170. });
  171. }
  172. }
  173. }
  174. // at this point, n is the parts, and we know it's not a comma set
  175. // with a single entry.
  176. // no need to expand pre, since it is guaranteed to be free of brace-sets
  177. var pre = m.pre;
  178. var post = m.post.length
  179. ? expand(m.post, false)
  180. : [''];
  181. var N;
  182. if (isSequence) {
  183. var x = numeric(n[0]);
  184. var y = numeric(n[1]);
  185. var width = Math.max(n[0].length, n[1].length)
  186. var incr = n.length == 3
  187. ? Math.abs(numeric(n[2]))
  188. : 1;
  189. var test = lte;
  190. var reverse = y < x;
  191. if (reverse) {
  192. incr *= -1;
  193. test = gte;
  194. }
  195. var pad = n.some(isPadded);
  196. N = [];
  197. for (var i = x; test(i, y); i += incr) {
  198. var c;
  199. if (isAlphaSequence) {
  200. c = String.fromCharCode(i);
  201. if (c === '\\')
  202. c = '';
  203. } else {
  204. c = String(i);
  205. if (pad) {
  206. var need = width - c.length;
  207. if (need > 0) {
  208. var z = new Array(need + 1).join('0');
  209. if (i < 0)
  210. c = '-' + z + c.slice(1);
  211. else
  212. c = z + c;
  213. }
  214. }
  215. }
  216. N.push(c);
  217. }
  218. } else {
  219. N = concatMap(n, function(el) { return expand(el, false) });
  220. }
  221. for (var j = 0; j < N.length; j++) {
  222. for (var k = 0; k < post.length; k++) {
  223. var expansion = pre + N[j] + post[k];
  224. if (!isTop || isSequence || expansion)
  225. expansions.push(expansion);
  226. }
  227. }
  228. return expansions;
  229. }
  230. /***/ }),
  231. /***/ 11048:
  232. /***/ ((module) => {
  233. module.exports = function (xs, fn) {
  234. var res = [];
  235. for (var i = 0; i < xs.length; i++) {
  236. var x = fn(xs[i], i);
  237. if (isArray(x)) res.push.apply(res, x);
  238. else res.push(x);
  239. }
  240. return res;
  241. };
  242. var isArray = Array.isArray || function (xs) {
  243. return Object.prototype.toString.call(xs) === '[object Array]';
  244. };
  245. /***/ }),
  246. /***/ 37334:
  247. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  248. module.exports = realpath
  249. realpath.realpath = realpath
  250. realpath.sync = realpathSync
  251. realpath.realpathSync = realpathSync
  252. realpath.monkeypatch = monkeypatch
  253. realpath.unmonkeypatch = unmonkeypatch
  254. var fs = __webpack_require__(35747)
  255. var origRealpath = fs.realpath
  256. var origRealpathSync = fs.realpathSync
  257. var version = process.version
  258. var ok = /^v[0-5]\./.test(version)
  259. var old = __webpack_require__(47059)
  260. function newError (er) {
  261. return er && er.syscall === 'realpath' && (
  262. er.code === 'ELOOP' ||
  263. er.code === 'ENOMEM' ||
  264. er.code === 'ENAMETOOLONG'
  265. )
  266. }
  267. function realpath (p, cache, cb) {
  268. if (ok) {
  269. return origRealpath(p, cache, cb)
  270. }
  271. if (typeof cache === 'function') {
  272. cb = cache
  273. cache = null
  274. }
  275. origRealpath(p, cache, function (er, result) {
  276. if (newError(er)) {
  277. old.realpath(p, cache, cb)
  278. } else {
  279. cb(er, result)
  280. }
  281. })
  282. }
  283. function realpathSync (p, cache) {
  284. if (ok) {
  285. return origRealpathSync(p, cache)
  286. }
  287. try {
  288. return origRealpathSync(p, cache)
  289. } catch (er) {
  290. if (newError(er)) {
  291. return old.realpathSync(p, cache)
  292. } else {
  293. throw er
  294. }
  295. }
  296. }
  297. function monkeypatch () {
  298. fs.realpath = realpath
  299. fs.realpathSync = realpathSync
  300. }
  301. function unmonkeypatch () {
  302. fs.realpath = origRealpath
  303. fs.realpathSync = origRealpathSync
  304. }
  305. /***/ }),
  306. /***/ 47059:
  307. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  308. // Copyright Joyent, Inc. and other Node contributors.
  309. //
  310. // Permission is hereby granted, free of charge, to any person obtaining a
  311. // copy of this software and associated documentation files (the
  312. // "Software"), to deal in the Software without restriction, including
  313. // without limitation the rights to use, copy, modify, merge, publish,
  314. // distribute, sublicense, and/or sell copies of the Software, and to permit
  315. // persons to whom the Software is furnished to do so, subject to the
  316. // following conditions:
  317. //
  318. // The above copyright notice and this permission notice shall be included
  319. // in all copies or substantial portions of the Software.
  320. //
  321. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  322. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  323. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  324. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  325. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  326. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  327. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  328. var pathModule = __webpack_require__(85622);
  329. var isWindows = process.platform === 'win32';
  330. var fs = __webpack_require__(35747);
  331. // JavaScript implementation of realpath, ported from node pre-v6
  332. var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
  333. function rethrow() {
  334. // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and
  335. // is fairly slow to generate.
  336. var callback;
  337. if (DEBUG) {
  338. var backtrace = new Error;
  339. callback = debugCallback;
  340. } else
  341. callback = missingCallback;
  342. return callback;
  343. function debugCallback(err) {
  344. if (err) {
  345. backtrace.message = err.message;
  346. err = backtrace;
  347. missingCallback(err);
  348. }
  349. }
  350. function missingCallback(err) {
  351. if (err) {
  352. if (process.throwDeprecation)
  353. throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs
  354. else if (!process.noDeprecation) {
  355. var msg = 'fs: missing callback ' + (err.stack || err.message);
  356. if (process.traceDeprecation)
  357. console.trace(msg);
  358. else
  359. console.error(msg);
  360. }
  361. }
  362. }
  363. }
  364. function maybeCallback(cb) {
  365. return typeof cb === 'function' ? cb : rethrow();
  366. }
  367. var normalize = pathModule.normalize;
  368. // Regexp that finds the next partion of a (partial) path
  369. // result is [base_with_slash, base], e.g. ['somedir/', 'somedir']
  370. if (isWindows) {
  371. var nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
  372. } else {
  373. var nextPartRe = /(.*?)(?:[\/]+|$)/g;
  374. }
  375. // Regex to find the device root, including trailing slash. E.g. 'c:\\'.
  376. if (isWindows) {
  377. var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
  378. } else {
  379. var splitRootRe = /^[\/]*/;
  380. }
  381. exports.realpathSync = function realpathSync(p, cache) {
  382. // make p is absolute
  383. p = pathModule.resolve(p);
  384. if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
  385. return cache[p];
  386. }
  387. var original = p,
  388. seenLinks = {},
  389. knownHard = {};
  390. // current character position in p
  391. var pos;
  392. // the partial path so far, including a trailing slash if any
  393. var current;
  394. // the partial path without a trailing slash (except when pointing at a root)
  395. var base;
  396. // the partial path scanned in the previous round, with slash
  397. var previous;
  398. start();
  399. function start() {
  400. // Skip over roots
  401. var m = splitRootRe.exec(p);
  402. pos = m[0].length;
  403. current = m[0];
  404. base = m[0];
  405. previous = '';
  406. // On windows, check that the root exists. On unix there is no need.
  407. if (isWindows && !knownHard[base]) {
  408. fs.lstatSync(base);
  409. knownHard[base] = true;
  410. }
  411. }
  412. // walk down the path, swapping out linked pathparts for their real
  413. // values
  414. // NB: p.length changes.
  415. while (pos < p.length) {
  416. // find the next part
  417. nextPartRe.lastIndex = pos;
  418. var result = nextPartRe.exec(p);
  419. previous = current;
  420. current += result[0];
  421. base = previous + result[1];
  422. pos = nextPartRe.lastIndex;
  423. // continue if not a symlink
  424. if (knownHard[base] || (cache && cache[base] === base)) {
  425. continue;
  426. }
  427. var resolvedLink;
  428. if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
  429. // some known symbolic link. no need to stat again.
  430. resolvedLink = cache[base];
  431. } else {
  432. var stat = fs.lstatSync(base);
  433. if (!stat.isSymbolicLink()) {
  434. knownHard[base] = true;
  435. if (cache) cache[base] = base;
  436. continue;
  437. }
  438. // read the link if it wasn't read before
  439. // dev/ino always return 0 on windows, so skip the check.
  440. var linkTarget = null;
  441. if (!isWindows) {
  442. var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
  443. if (seenLinks.hasOwnProperty(id)) {
  444. linkTarget = seenLinks[id];
  445. }
  446. }
  447. if (linkTarget === null) {
  448. fs.statSync(base);
  449. linkTarget = fs.readlinkSync(base);
  450. }
  451. resolvedLink = pathModule.resolve(previous, linkTarget);
  452. // track this, if given a cache.
  453. if (cache) cache[base] = resolvedLink;
  454. if (!isWindows) seenLinks[id] = linkTarget;
  455. }
  456. // resolve the link, then start over
  457. p = pathModule.resolve(resolvedLink, p.slice(pos));
  458. start();
  459. }
  460. if (cache) cache[original] = p;
  461. return p;
  462. };
  463. exports.realpath = function realpath(p, cache, cb) {
  464. if (typeof cb !== 'function') {
  465. cb = maybeCallback(cache);
  466. cache = null;
  467. }
  468. // make p is absolute
  469. p = pathModule.resolve(p);
  470. if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
  471. return process.nextTick(cb.bind(null, null, cache[p]));
  472. }
  473. var original = p,
  474. seenLinks = {},
  475. knownHard = {};
  476. // current character position in p
  477. var pos;
  478. // the partial path so far, including a trailing slash if any
  479. var current;
  480. // the partial path without a trailing slash (except when pointing at a root)
  481. var base;
  482. // the partial path scanned in the previous round, with slash
  483. var previous;
  484. start();
  485. function start() {
  486. // Skip over roots
  487. var m = splitRootRe.exec(p);
  488. pos = m[0].length;
  489. current = m[0];
  490. base = m[0];
  491. previous = '';
  492. // On windows, check that the root exists. On unix there is no need.
  493. if (isWindows && !knownHard[base]) {
  494. fs.lstat(base, function(err) {
  495. if (err) return cb(err);
  496. knownHard[base] = true;
  497. LOOP();
  498. });
  499. } else {
  500. process.nextTick(LOOP);
  501. }
  502. }
  503. // walk down the path, swapping out linked pathparts for their real
  504. // values
  505. function LOOP() {
  506. // stop if scanned past end of path
  507. if (pos >= p.length) {
  508. if (cache) cache[original] = p;
  509. return cb(null, p);
  510. }
  511. // find the next part
  512. nextPartRe.lastIndex = pos;
  513. var result = nextPartRe.exec(p);
  514. previous = current;
  515. current += result[0];
  516. base = previous + result[1];
  517. pos = nextPartRe.lastIndex;
  518. // continue if not a symlink
  519. if (knownHard[base] || (cache && cache[base] === base)) {
  520. return process.nextTick(LOOP);
  521. }
  522. if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
  523. // known symbolic link. no need to stat again.
  524. return gotResolvedLink(cache[base]);
  525. }
  526. return fs.lstat(base, gotStat);
  527. }
  528. function gotStat(err, stat) {
  529. if (err) return cb(err);
  530. // if not a symlink, skip to the next path part
  531. if (!stat.isSymbolicLink()) {
  532. knownHard[base] = true;
  533. if (cache) cache[base] = base;
  534. return process.nextTick(LOOP);
  535. }
  536. // stat & read the link if not read before
  537. // call gotTarget as soon as the link target is known
  538. // dev/ino always return 0 on windows, so skip the check.
  539. if (!isWindows) {
  540. var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
  541. if (seenLinks.hasOwnProperty(id)) {
  542. return gotTarget(null, seenLinks[id], base);
  543. }
  544. }
  545. fs.stat(base, function(err) {
  546. if (err) return cb(err);
  547. fs.readlink(base, function(err, target) {
  548. if (!isWindows) seenLinks[id] = target;
  549. gotTarget(err, target);
  550. });
  551. });
  552. }
  553. function gotTarget(err, target, base) {
  554. if (err) return cb(err);
  555. var resolvedLink = pathModule.resolve(previous, target);
  556. if (cache) cache[base] = resolvedLink;
  557. gotResolvedLink(resolvedLink);
  558. }
  559. function gotResolvedLink(resolvedLink) {
  560. // resolve the link, then start over
  561. p = pathModule.resolve(resolvedLink, p.slice(pos));
  562. start();
  563. }
  564. };
  565. /***/ }),
  566. /***/ 66772:
  567. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  568. exports.setopts = setopts
  569. exports.ownProp = ownProp
  570. exports.makeAbs = makeAbs
  571. exports.finish = finish
  572. exports.mark = mark
  573. exports.isIgnored = isIgnored
  574. exports.childrenIgnored = childrenIgnored
  575. function ownProp (obj, field) {
  576. return Object.prototype.hasOwnProperty.call(obj, field)
  577. }
  578. var path = __webpack_require__(85622)
  579. var minimatch = __webpack_require__(91171)
  580. var isAbsolute = __webpack_require__(64095)
  581. var Minimatch = minimatch.Minimatch
  582. function alphasort (a, b) {
  583. return a.localeCompare(b, 'en')
  584. }
  585. function setupIgnores (self, options) {
  586. self.ignore = options.ignore || []
  587. if (!Array.isArray(self.ignore))
  588. self.ignore = [self.ignore]
  589. if (self.ignore.length) {
  590. self.ignore = self.ignore.map(ignoreMap)
  591. }
  592. }
  593. // ignore patterns are always in dot:true mode.
  594. function ignoreMap (pattern) {
  595. var gmatcher = null
  596. if (pattern.slice(-3) === '/**') {
  597. var gpattern = pattern.replace(/(\/\*\*)+$/, '')
  598. gmatcher = new Minimatch(gpattern, { dot: true })
  599. }
  600. return {
  601. matcher: new Minimatch(pattern, { dot: true }),
  602. gmatcher: gmatcher
  603. }
  604. }
  605. function setopts (self, pattern, options) {
  606. if (!options)
  607. options = {}
  608. // base-matching: just use globstar for that.
  609. if (options.matchBase && -1 === pattern.indexOf("/")) {
  610. if (options.noglobstar) {
  611. throw new Error("base matching requires globstar")
  612. }
  613. pattern = "**/" + pattern
  614. }
  615. self.silent = !!options.silent
  616. self.pattern = pattern
  617. self.strict = options.strict !== false
  618. self.realpath = !!options.realpath
  619. self.realpathCache = options.realpathCache || Object.create(null)
  620. self.follow = !!options.follow
  621. self.dot = !!options.dot
  622. self.mark = !!options.mark
  623. self.nodir = !!options.nodir
  624. if (self.nodir)
  625. self.mark = true
  626. self.sync = !!options.sync
  627. self.nounique = !!options.nounique
  628. self.nonull = !!options.nonull
  629. self.nosort = !!options.nosort
  630. self.nocase = !!options.nocase
  631. self.stat = !!options.stat
  632. self.noprocess = !!options.noprocess
  633. self.absolute = !!options.absolute
  634. self.maxLength = options.maxLength || Infinity
  635. self.cache = options.cache || Object.create(null)
  636. self.statCache = options.statCache || Object.create(null)
  637. self.symlinks = options.symlinks || Object.create(null)
  638. setupIgnores(self, options)
  639. self.changedCwd = false
  640. var cwd = process.cwd()
  641. if (!ownProp(options, "cwd"))
  642. self.cwd = cwd
  643. else {
  644. self.cwd = path.resolve(options.cwd)
  645. self.changedCwd = self.cwd !== cwd
  646. }
  647. self.root = options.root || path.resolve(self.cwd, "/")
  648. self.root = path.resolve(self.root)
  649. if (process.platform === "win32")
  650. self.root = self.root.replace(/\\/g, "/")
  651. // TODO: is an absolute `cwd` supposed to be resolved against `root`?
  652. // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test')
  653. self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd)
  654. if (process.platform === "win32")
  655. self.cwdAbs = self.cwdAbs.replace(/\\/g, "/")
  656. self.nomount = !!options.nomount
  657. // disable comments and negation in Minimatch.
  658. // Note that they are not supported in Glob itself anyway.
  659. options.nonegate = true
  660. options.nocomment = true
  661. self.minimatch = new Minimatch(pattern, options)
  662. self.options = self.minimatch.options
  663. }
  664. function finish (self) {
  665. var nou = self.nounique
  666. var all = nou ? [] : Object.create(null)
  667. for (var i = 0, l = self.matches.length; i < l; i ++) {
  668. var matches = self.matches[i]
  669. if (!matches || Object.keys(matches).length === 0) {
  670. if (self.nonull) {
  671. // do like the shell, and spit out the literal glob
  672. var literal = self.minimatch.globSet[i]
  673. if (nou)
  674. all.push(literal)
  675. else
  676. all[literal] = true
  677. }
  678. } else {
  679. // had matches
  680. var m = Object.keys(matches)
  681. if (nou)
  682. all.push.apply(all, m)
  683. else
  684. m.forEach(function (m) {
  685. all[m] = true
  686. })
  687. }
  688. }
  689. if (!nou)
  690. all = Object.keys(all)
  691. if (!self.nosort)
  692. all = all.sort(alphasort)
  693. // at *some* point we statted all of these
  694. if (self.mark) {
  695. for (var i = 0; i < all.length; i++) {
  696. all[i] = self._mark(all[i])
  697. }
  698. if (self.nodir) {
  699. all = all.filter(function (e) {
  700. var notDir = !(/\/$/.test(e))
  701. var c = self.cache[e] || self.cache[makeAbs(self, e)]
  702. if (notDir && c)
  703. notDir = c !== 'DIR' && !Array.isArray(c)
  704. return notDir
  705. })
  706. }
  707. }
  708. if (self.ignore.length)
  709. all = all.filter(function(m) {
  710. return !isIgnored(self, m)
  711. })
  712. self.found = all
  713. }
  714. function mark (self, p) {
  715. var abs = makeAbs(self, p)
  716. var c = self.cache[abs]
  717. var m = p
  718. if (c) {
  719. var isDir = c === 'DIR' || Array.isArray(c)
  720. var slash = p.slice(-1) === '/'
  721. if (isDir && !slash)
  722. m += '/'
  723. else if (!isDir && slash)
  724. m = m.slice(0, -1)
  725. if (m !== p) {
  726. var mabs = makeAbs(self, m)
  727. self.statCache[mabs] = self.statCache[abs]
  728. self.cache[mabs] = self.cache[abs]
  729. }
  730. }
  731. return m
  732. }
  733. // lotta situps...
  734. function makeAbs (self, f) {
  735. var abs = f
  736. if (f.charAt(0) === '/') {
  737. abs = path.join(self.root, f)
  738. } else if (isAbsolute(f) || f === '') {
  739. abs = f
  740. } else if (self.changedCwd) {
  741. abs = path.resolve(self.cwd, f)
  742. } else {
  743. abs = path.resolve(f)
  744. }
  745. if (process.platform === 'win32')
  746. abs = abs.replace(/\\/g, '/')
  747. return abs
  748. }
  749. // Return true, if pattern ends with globstar '**', for the accompanying parent directory.
  750. // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
  751. function isIgnored (self, path) {
  752. if (!self.ignore.length)
  753. return false
  754. return self.ignore.some(function(item) {
  755. return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
  756. })
  757. }
  758. function childrenIgnored (self, path) {
  759. if (!self.ignore.length)
  760. return false
  761. return self.ignore.some(function(item) {
  762. return !!(item.gmatcher && item.gmatcher.match(path))
  763. })
  764. }
  765. /***/ }),
  766. /***/ 12884:
  767. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  768. // Approach:
  769. //
  770. // 1. Get the minimatch set
  771. // 2. For each pattern in the set, PROCESS(pattern, false)
  772. // 3. Store matches per-set, then uniq them
  773. //
  774. // PROCESS(pattern, inGlobStar)
  775. // Get the first [n] items from pattern that are all strings
  776. // Join these together. This is PREFIX.
  777. // If there is no more remaining, then stat(PREFIX) and
  778. // add to matches if it succeeds. END.
  779. //
  780. // If inGlobStar and PREFIX is symlink and points to dir
  781. // set ENTRIES = []
  782. // else readdir(PREFIX) as ENTRIES
  783. // If fail, END
  784. //
  785. // with ENTRIES
  786. // If pattern[n] is GLOBSTAR
  787. // // handle the case where the globstar match is empty
  788. // // by pruning it out, and testing the resulting pattern
  789. // PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
  790. // // handle other cases.
  791. // for ENTRY in ENTRIES (not dotfiles)
  792. // // attach globstar + tail onto the entry
  793. // // Mark that this entry is a globstar match
  794. // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
  795. //
  796. // else // not globstar
  797. // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
  798. // Test ENTRY against pattern[n]
  799. // If fails, continue
  800. // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
  801. //
  802. // Caveat:
  803. // Cache all stats and readdirs results to minimize syscall. Since all
  804. // we ever care about is existence and directory-ness, we can just keep
  805. // `true` for files, and [children,...] for directories, or `false` for
  806. // things that don't exist.
  807. module.exports = glob
  808. var fs = __webpack_require__(35747)
  809. var rp = __webpack_require__(37334)
  810. var minimatch = __webpack_require__(91171)
  811. var Minimatch = minimatch.Minimatch
  812. var inherits = __webpack_require__(94378)
  813. var EE = __webpack_require__(28614).EventEmitter
  814. var path = __webpack_require__(85622)
  815. var assert = __webpack_require__(42357)
  816. var isAbsolute = __webpack_require__(64095)
  817. var globSync = __webpack_require__(14751)
  818. var common = __webpack_require__(66772)
  819. var setopts = common.setopts
  820. var ownProp = common.ownProp
  821. var inflight = __webpack_require__(67844)
  822. var util = __webpack_require__(31669)
  823. var childrenIgnored = common.childrenIgnored
  824. var isIgnored = common.isIgnored
  825. var once = __webpack_require__(30778)
  826. function glob (pattern, options, cb) {
  827. if (typeof options === 'function') cb = options, options = {}
  828. if (!options) options = {}
  829. if (options.sync) {
  830. if (cb)
  831. throw new TypeError('callback provided to sync glob')
  832. return globSync(pattern, options)
  833. }
  834. return new Glob(pattern, options, cb)
  835. }
  836. glob.sync = globSync
  837. var GlobSync = glob.GlobSync = globSync.GlobSync
  838. // old api surface
  839. glob.glob = glob
  840. function extend (origin, add) {
  841. if (add === null || typeof add !== 'object') {
  842. return origin
  843. }
  844. var keys = Object.keys(add)
  845. var i = keys.length
  846. while (i--) {
  847. origin[keys[i]] = add[keys[i]]
  848. }
  849. return origin
  850. }
  851. glob.hasMagic = function (pattern, options_) {
  852. var options = extend({}, options_)
  853. options.noprocess = true
  854. var g = new Glob(pattern, options)
  855. var set = g.minimatch.set
  856. if (!pattern)
  857. return false
  858. if (set.length > 1)
  859. return true
  860. for (var j = 0; j < set[0].length; j++) {
  861. if (typeof set[0][j] !== 'string')
  862. return true
  863. }
  864. return false
  865. }
  866. glob.Glob = Glob
  867. inherits(Glob, EE)
  868. function Glob (pattern, options, cb) {
  869. if (typeof options === 'function') {
  870. cb = options
  871. options = null
  872. }
  873. if (options && options.sync) {
  874. if (cb)
  875. throw new TypeError('callback provided to sync glob')
  876. return new GlobSync(pattern, options)
  877. }
  878. if (!(this instanceof Glob))
  879. return new Glob(pattern, options, cb)
  880. setopts(this, pattern, options)
  881. this._didRealPath = false
  882. // process each pattern in the minimatch set
  883. var n = this.minimatch.set.length
  884. // The matches are stored as {<filename>: true,...} so that
  885. // duplicates are automagically pruned.
  886. // Later, we do an Object.keys() on these.
  887. // Keep them as a list so we can fill in when nonull is set.
  888. this.matches = new Array(n)
  889. if (typeof cb === 'function') {
  890. cb = once(cb)
  891. this.on('error', cb)
  892. this.on('end', function (matches) {
  893. cb(null, matches)
  894. })
  895. }
  896. var self = this
  897. this._processing = 0
  898. this._emitQueue = []
  899. this._processQueue = []
  900. this.paused = false
  901. if (this.noprocess)
  902. return this
  903. if (n === 0)
  904. return done()
  905. var sync = true
  906. for (var i = 0; i < n; i ++) {
  907. this._process(this.minimatch.set[i], i, false, done)
  908. }
  909. sync = false
  910. function done () {
  911. --self._processing
  912. if (self._processing <= 0) {
  913. if (sync) {
  914. process.nextTick(function () {
  915. self._finish()
  916. })
  917. } else {
  918. self._finish()
  919. }
  920. }
  921. }
  922. }
  923. Glob.prototype._finish = function () {
  924. assert(this instanceof Glob)
  925. if (this.aborted)
  926. return
  927. if (this.realpath && !this._didRealpath)
  928. return this._realpath()
  929. common.finish(this)
  930. this.emit('end', this.found)
  931. }
  932. Glob.prototype._realpath = function () {
  933. if (this._didRealpath)
  934. return
  935. this._didRealpath = true
  936. var n = this.matches.length
  937. if (n === 0)
  938. return this._finish()
  939. var self = this
  940. for (var i = 0; i < this.matches.length; i++)
  941. this._realpathSet(i, next)
  942. function next () {
  943. if (--n === 0)
  944. self._finish()
  945. }
  946. }
  947. Glob.prototype._realpathSet = function (index, cb) {
  948. var matchset = this.matches[index]
  949. if (!matchset)
  950. return cb()
  951. var found = Object.keys(matchset)
  952. var self = this
  953. var n = found.length
  954. if (n === 0)
  955. return cb()
  956. var set = this.matches[index] = Object.create(null)
  957. found.forEach(function (p, i) {
  958. // If there's a problem with the stat, then it means that
  959. // one or more of the links in the realpath couldn't be
  960. // resolved. just return the abs value in that case.
  961. p = self._makeAbs(p)
  962. rp.realpath(p, self.realpathCache, function (er, real) {
  963. if (!er)
  964. set[real] = true
  965. else if (er.syscall === 'stat')
  966. set[p] = true
  967. else
  968. self.emit('error', er) // srsly wtf right here
  969. if (--n === 0) {
  970. self.matches[index] = set
  971. cb()
  972. }
  973. })
  974. })
  975. }
  976. Glob.prototype._mark = function (p) {
  977. return common.mark(this, p)
  978. }
  979. Glob.prototype._makeAbs = function (f) {
  980. return common.makeAbs(this, f)
  981. }
  982. Glob.prototype.abort = function () {
  983. this.aborted = true
  984. this.emit('abort')
  985. }
  986. Glob.prototype.pause = function () {
  987. if (!this.paused) {
  988. this.paused = true
  989. this.emit('pause')
  990. }
  991. }
  992. Glob.prototype.resume = function () {
  993. if (this.paused) {
  994. this.emit('resume')
  995. this.paused = false
  996. if (this._emitQueue.length) {
  997. var eq = this._emitQueue.slice(0)
  998. this._emitQueue.length = 0
  999. for (var i = 0; i < eq.length; i ++) {
  1000. var e = eq[i]
  1001. this._emitMatch(e[0], e[1])
  1002. }
  1003. }
  1004. if (this._processQueue.length) {
  1005. var pq = this._processQueue.slice(0)
  1006. this._processQueue.length = 0
  1007. for (var i = 0; i < pq.length; i ++) {
  1008. var p = pq[i]
  1009. this._processing--
  1010. this._process(p[0], p[1], p[2], p[3])
  1011. }
  1012. }
  1013. }
  1014. }
  1015. Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
  1016. assert(this instanceof Glob)
  1017. assert(typeof cb === 'function')
  1018. if (this.aborted)
  1019. return
  1020. this._processing++
  1021. if (this.paused) {
  1022. this._processQueue.push([pattern, index, inGlobStar, cb])
  1023. return
  1024. }
  1025. //console.error('PROCESS %d', this._processing, pattern)
  1026. // Get the first [n] parts of pattern that are all strings.
  1027. var n = 0
  1028. while (typeof pattern[n] === 'string') {
  1029. n ++
  1030. }
  1031. // now n is the index of the first one that is *not* a string.
  1032. // see if there's anything else
  1033. var prefix
  1034. switch (n) {
  1035. // if not, then this is rather simple
  1036. case pattern.length:
  1037. this._processSimple(pattern.join('/'), index, cb)
  1038. return
  1039. case 0:
  1040. // pattern *starts* with some non-trivial item.
  1041. // going to readdir(cwd), but not include the prefix in matches.
  1042. prefix = null
  1043. break
  1044. default:
  1045. // pattern has some string bits in the front.
  1046. // whatever it starts with, whether that's 'absolute' like /foo/bar,
  1047. // or 'relative' like '../baz'
  1048. prefix = pattern.slice(0, n).join('/')
  1049. break
  1050. }
  1051. var remain = pattern.slice(n)
  1052. // get the list of entries.
  1053. var read
  1054. if (prefix === null)
  1055. read = '.'
  1056. else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
  1057. if (!prefix || !isAbsolute(prefix))
  1058. prefix = '/' + prefix
  1059. read = prefix
  1060. } else
  1061. read = prefix
  1062. var abs = this._makeAbs(read)
  1063. //if ignored, skip _processing
  1064. if (childrenIgnored(this, read))
  1065. return cb()
  1066. var isGlobStar = remain[0] === minimatch.GLOBSTAR
  1067. if (isGlobStar)
  1068. this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
  1069. else
  1070. this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
  1071. }
  1072. Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
  1073. var self = this
  1074. this._readdir(abs, inGlobStar, function (er, entries) {
  1075. return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
  1076. })
  1077. }
  1078. Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
  1079. // if the abs isn't a dir, then nothing can match!
  1080. if (!entries)
  1081. return cb()
  1082. // It will only match dot entries if it starts with a dot, or if
  1083. // dot is set. Stuff like @(.foo|.bar) isn't allowed.
  1084. var pn = remain[0]
  1085. var negate = !!this.minimatch.negate
  1086. var rawGlob = pn._glob
  1087. var dotOk = this.dot || rawGlob.charAt(0) === '.'
  1088. var matchedEntries = []
  1089. for (var i = 0; i < entries.length; i++) {
  1090. var e = entries[i]
  1091. if (e.charAt(0) !== '.' || dotOk) {
  1092. var m
  1093. if (negate && !prefix) {
  1094. m = !e.match(pn)
  1095. } else {
  1096. m = e.match(pn)
  1097. }
  1098. if (m)
  1099. matchedEntries.push(e)
  1100. }
  1101. }
  1102. //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
  1103. var len = matchedEntries.length
  1104. // If there are no matched entries, then nothing matches.
  1105. if (len === 0)
  1106. return cb()
  1107. // if this is the last remaining pattern bit, then no need for
  1108. // an additional stat *unless* the user has specified mark or
  1109. // stat explicitly. We know they exist, since readdir returned
  1110. // them.
  1111. if (remain.length === 1 && !this.mark && !this.stat) {
  1112. if (!this.matches[index])
  1113. this.matches[index] = Object.create(null)
  1114. for (var i = 0; i < len; i ++) {
  1115. var e = matchedEntries[i]
  1116. if (prefix) {
  1117. if (prefix !== '/')
  1118. e = prefix + '/' + e
  1119. else
  1120. e = prefix + e
  1121. }
  1122. if (e.charAt(0) === '/' && !this.nomount) {
  1123. e = path.join(this.root, e)
  1124. }
  1125. this._emitMatch(index, e)
  1126. }
  1127. // This was the last one, and no stats were needed
  1128. return cb()
  1129. }
  1130. // now test all matched entries as stand-ins for that part
  1131. // of the pattern.
  1132. remain.shift()
  1133. for (var i = 0; i < len; i ++) {
  1134. var e = matchedEntries[i]
  1135. var newPattern
  1136. if (prefix) {
  1137. if (prefix !== '/')
  1138. e = prefix + '/' + e
  1139. else
  1140. e = prefix + e
  1141. }
  1142. this._process([e].concat(remain), index, inGlobStar, cb)
  1143. }
  1144. cb()
  1145. }
  1146. Glob.prototype._emitMatch = function (index, e) {
  1147. if (this.aborted)
  1148. return
  1149. if (isIgnored(this, e))
  1150. return
  1151. if (this.paused) {
  1152. this._emitQueue.push([index, e])
  1153. return
  1154. }
  1155. var abs = isAbsolute(e) ? e : this._makeAbs(e)
  1156. if (this.mark)
  1157. e = this._mark(e)
  1158. if (this.absolute)
  1159. e = abs
  1160. if (this.matches[index][e])
  1161. return
  1162. if (this.nodir) {
  1163. var c = this.cache[abs]
  1164. if (c === 'DIR' || Array.isArray(c))
  1165. return
  1166. }
  1167. this.matches[index][e] = true
  1168. var st = this.statCache[abs]
  1169. if (st)
  1170. this.emit('stat', e, st)
  1171. this.emit('match', e)
  1172. }
  1173. Glob.prototype._readdirInGlobStar = function (abs, cb) {
  1174. if (this.aborted)
  1175. return
  1176. // follow all symlinked directories forever
  1177. // just proceed as if this is a non-globstar situation
  1178. if (this.follow)
  1179. return this._readdir(abs, false, cb)
  1180. var lstatkey = 'lstat\0' + abs
  1181. var self = this
  1182. var lstatcb = inflight(lstatkey, lstatcb_)
  1183. if (lstatcb)
  1184. fs.lstat(abs, lstatcb)
  1185. function lstatcb_ (er, lstat) {
  1186. if (er && er.code === 'ENOENT')
  1187. return cb()
  1188. var isSym = lstat && lstat.isSymbolicLink()
  1189. self.symlinks[abs] = isSym
  1190. // If it's not a symlink or a dir, then it's definitely a regular file.
  1191. // don't bother doing a readdir in that case.
  1192. if (!isSym && lstat && !lstat.isDirectory()) {
  1193. self.cache[abs] = 'FILE'
  1194. cb()
  1195. } else
  1196. self._readdir(abs, false, cb)
  1197. }
  1198. }
  1199. Glob.prototype._readdir = function (abs, inGlobStar, cb) {
  1200. if (this.aborted)
  1201. return
  1202. cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
  1203. if (!cb)
  1204. return
  1205. //console.error('RD %j %j', +inGlobStar, abs)
  1206. if (inGlobStar && !ownProp(this.symlinks, abs))
  1207. return this._readdirInGlobStar(abs, cb)
  1208. if (ownProp(this.cache, abs)) {
  1209. var c = this.cache[abs]
  1210. if (!c || c === 'FILE')
  1211. return cb()
  1212. if (Array.isArray(c))
  1213. return cb(null, c)
  1214. }
  1215. var self = this
  1216. fs.readdir(abs, readdirCb(this, abs, cb))
  1217. }
  1218. function readdirCb (self, abs, cb) {
  1219. return function (er, entries) {
  1220. if (er)
  1221. self._readdirError(abs, er, cb)
  1222. else
  1223. self._readdirEntries(abs, entries, cb)
  1224. }
  1225. }
  1226. Glob.prototype._readdirEntries = function (abs, entries, cb) {
  1227. if (this.aborted)
  1228. return
  1229. // if we haven't asked to stat everything, then just
  1230. // assume that everything in there exists, so we can avoid
  1231. // having to stat it a second time.
  1232. if (!this.mark && !this.stat) {
  1233. for (var i = 0; i < entries.length; i ++) {
  1234. var e = entries[i]
  1235. if (abs === '/')
  1236. e = abs + e
  1237. else
  1238. e = abs + '/' + e
  1239. this.cache[e] = true
  1240. }
  1241. }
  1242. this.cache[abs] = entries
  1243. return cb(null, entries)
  1244. }
  1245. Glob.prototype._readdirError = function (f, er, cb) {
  1246. if (this.aborted)
  1247. return
  1248. // handle errors, and cache the information
  1249. switch (er.code) {
  1250. case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
  1251. case 'ENOTDIR': // totally normal. means it *does* exist.
  1252. var abs = this._makeAbs(f)
  1253. this.cache[abs] = 'FILE'
  1254. if (abs === this.cwdAbs) {
  1255. var error = new Error(er.code + ' invalid cwd ' + this.cwd)
  1256. error.path = this.cwd
  1257. error.code = er.code
  1258. this.emit('error', error)
  1259. this.abort()
  1260. }
  1261. break
  1262. case 'ENOENT': // not terribly unusual
  1263. case 'ELOOP':
  1264. case 'ENAMETOOLONG':
  1265. case 'UNKNOWN':
  1266. this.cache[this._makeAbs(f)] = false
  1267. break
  1268. default: // some unusual error. Treat as failure.
  1269. this.cache[this._makeAbs(f)] = false
  1270. if (this.strict) {
  1271. this.emit('error', er)
  1272. // If the error is handled, then we abort
  1273. // if not, we threw out of here
  1274. this.abort()
  1275. }
  1276. if (!this.silent)
  1277. console.error('glob error', er)
  1278. break
  1279. }
  1280. return cb()
  1281. }
  1282. Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
  1283. var self = this
  1284. this._readdir(abs, inGlobStar, function (er, entries) {
  1285. self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
  1286. })
  1287. }
  1288. Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
  1289. //console.error('pgs2', prefix, remain[0], entries)
  1290. // no entries means not a dir, so it can never have matches
  1291. // foo.txt/** doesn't match foo.txt
  1292. if (!entries)
  1293. return cb()
  1294. // test without the globstar, and with every child both below
  1295. // and replacing the globstar.
  1296. var remainWithoutGlobStar = remain.slice(1)
  1297. var gspref = prefix ? [ prefix ] : []
  1298. var noGlobStar = gspref.concat(remainWithoutGlobStar)
  1299. // the noGlobStar pattern exits the inGlobStar state
  1300. this._process(noGlobStar, index, false, cb)
  1301. var isSym = this.symlinks[abs]
  1302. var len = entries.length
  1303. // If it's a symlink, and we're in a globstar, then stop
  1304. if (isSym && inGlobStar)
  1305. return cb()
  1306. for (var i = 0; i < len; i++) {
  1307. var e = entries[i]
  1308. if (e.charAt(0) === '.' && !this.dot)
  1309. continue
  1310. // these two cases enter the inGlobStar state
  1311. var instead = gspref.concat(entries[i], remainWithoutGlobStar)
  1312. this._process(instead, index, true, cb)
  1313. var below = gspref.concat(entries[i], remain)
  1314. this._process(below, index, true, cb)
  1315. }
  1316. cb()
  1317. }
  1318. Glob.prototype._processSimple = function (prefix, index, cb) {
  1319. // XXX review this. Shouldn't it be doing the mounting etc
  1320. // before doing stat? kinda weird?
  1321. var self = this
  1322. this._stat(prefix, function (er, exists) {
  1323. self._processSimple2(prefix, index, er, exists, cb)
  1324. })
  1325. }
  1326. Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
  1327. //console.error('ps2', prefix, exists)
  1328. if (!this.matches[index])
  1329. this.matches[index] = Object.create(null)
  1330. // If it doesn't exist, then just mark the lack of results
  1331. if (!exists)
  1332. return cb()
  1333. if (prefix && isAbsolute(prefix) && !this.nomount) {
  1334. var trail = /[\/\\]$/.test(prefix)
  1335. if (prefix.charAt(0) === '/') {
  1336. prefix = path.join(this.root, prefix)
  1337. } else {
  1338. prefix = path.resolve(this.root, prefix)
  1339. if (trail)
  1340. prefix += '/'
  1341. }
  1342. }
  1343. if (process.platform === 'win32')
  1344. prefix = prefix.replace(/\\/g, '/')
  1345. // Mark this as a match
  1346. this._emitMatch(index, prefix)
  1347. cb()
  1348. }
  1349. // Returns either 'DIR', 'FILE', or false
  1350. Glob.prototype._stat = function (f, cb) {
  1351. var abs = this._makeAbs(f)
  1352. var needDir = f.slice(-1) === '/'
  1353. if (f.length > this.maxLength)
  1354. return cb()
  1355. if (!this.stat && ownProp(this.cache, abs)) {
  1356. var c = this.cache[abs]
  1357. if (Array.isArray(c))
  1358. c = 'DIR'
  1359. // It exists, but maybe not how we need it
  1360. if (!needDir || c === 'DIR')
  1361. return cb(null, c)
  1362. if (needDir && c === 'FILE')
  1363. return cb()
  1364. // otherwise we have to stat, because maybe c=true
  1365. // if we know it exists, but not what it is.
  1366. }
  1367. var exists
  1368. var stat = this.statCache[abs]
  1369. if (stat !== undefined) {
  1370. if (stat === false)
  1371. return cb(null, stat)
  1372. else {
  1373. var type = stat.isDirectory() ? 'DIR' : 'FILE'
  1374. if (needDir && type === 'FILE')
  1375. return cb()
  1376. else
  1377. return cb(null, type, stat)
  1378. }
  1379. }
  1380. var self = this
  1381. var statcb = inflight('stat\0' + abs, lstatcb_)
  1382. if (statcb)
  1383. fs.lstat(abs, statcb)
  1384. function lstatcb_ (er, lstat) {
  1385. if (lstat && lstat.isSymbolicLink()) {
  1386. // If it's a symlink, then treat it as the target, unless
  1387. // the target does not exist, then treat it as a file.
  1388. return fs.stat(abs, function (er, stat) {
  1389. if (er)
  1390. self._stat2(f, abs, null, lstat, cb)
  1391. else
  1392. self._stat2(f, abs, er, stat, cb)
  1393. })
  1394. } else {
  1395. self._stat2(f, abs, er, lstat, cb)
  1396. }
  1397. }
  1398. }
  1399. Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
  1400. if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
  1401. this.statCache[abs] = false
  1402. return cb()
  1403. }
  1404. var needDir = f.slice(-1) === '/'
  1405. this.statCache[abs] = stat
  1406. if (abs.slice(-1) === '/' && stat && !stat.isDirectory())
  1407. return cb(null, false, stat)
  1408. var c = true
  1409. if (stat)
  1410. c = stat.isDirectory() ? 'DIR' : 'FILE'
  1411. this.cache[abs] = this.cache[abs] || c
  1412. if (needDir && c === 'FILE')
  1413. return cb()
  1414. return cb(null, c, stat)
  1415. }
  1416. /***/ }),
  1417. /***/ 14751:
  1418. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1419. module.exports = globSync
  1420. globSync.GlobSync = GlobSync
  1421. var fs = __webpack_require__(35747)
  1422. var rp = __webpack_require__(37334)
  1423. var minimatch = __webpack_require__(91171)
  1424. var Minimatch = minimatch.Minimatch
  1425. var Glob = __webpack_require__(12884).Glob
  1426. var util = __webpack_require__(31669)
  1427. var path = __webpack_require__(85622)
  1428. var assert = __webpack_require__(42357)
  1429. var isAbsolute = __webpack_require__(64095)
  1430. var common = __webpack_require__(66772)
  1431. var setopts = common.setopts
  1432. var ownProp = common.ownProp
  1433. var childrenIgnored = common.childrenIgnored
  1434. var isIgnored = common.isIgnored
  1435. function globSync (pattern, options) {
  1436. if (typeof options === 'function' || arguments.length === 3)
  1437. throw new TypeError('callback provided to sync glob\n'+
  1438. 'See: https://github.com/isaacs/node-glob/issues/167')
  1439. return new GlobSync(pattern, options).found
  1440. }
  1441. function GlobSync (pattern, options) {
  1442. if (!pattern)
  1443. throw new Error('must provide pattern')
  1444. if (typeof options === 'function' || arguments.length === 3)
  1445. throw new TypeError('callback provided to sync glob\n'+
  1446. 'See: https://github.com/isaacs/node-glob/issues/167')
  1447. if (!(this instanceof GlobSync))
  1448. return new GlobSync(pattern, options)
  1449. setopts(this, pattern, options)
  1450. if (this.noprocess)
  1451. return this
  1452. var n = this.minimatch.set.length
  1453. this.matches = new Array(n)
  1454. for (var i = 0; i < n; i ++) {
  1455. this._process(this.minimatch.set[i], i, false)
  1456. }
  1457. this._finish()
  1458. }
  1459. GlobSync.prototype._finish = function () {
  1460. assert(this instanceof GlobSync)
  1461. if (this.realpath) {
  1462. var self = this
  1463. this.matches.forEach(function (matchset, index) {
  1464. var set = self.matches[index] = Object.create(null)
  1465. for (var p in matchset) {
  1466. try {
  1467. p = self._makeAbs(p)
  1468. var real = rp.realpathSync(p, self.realpathCache)
  1469. set[real] = true
  1470. } catch (er) {
  1471. if (er.syscall === 'stat')
  1472. set[self._makeAbs(p)] = true
  1473. else
  1474. throw er
  1475. }
  1476. }
  1477. })
  1478. }
  1479. common.finish(this)
  1480. }
  1481. GlobSync.prototype._process = function (pattern, index, inGlobStar) {
  1482. assert(this instanceof GlobSync)
  1483. // Get the first [n] parts of pattern that are all strings.
  1484. var n = 0
  1485. while (typeof pattern[n] === 'string') {
  1486. n ++
  1487. }
  1488. // now n is the index of the first one that is *not* a string.
  1489. // See if there's anything else
  1490. var prefix
  1491. switch (n) {
  1492. // if not, then this is rather simple
  1493. case pattern.length:
  1494. this._processSimple(pattern.join('/'), index)
  1495. return
  1496. case 0:
  1497. // pattern *starts* with some non-trivial item.
  1498. // going to readdir(cwd), but not include the prefix in matches.
  1499. prefix = null
  1500. break
  1501. default:
  1502. // pattern has some string bits in the front.
  1503. // whatever it starts with, whether that's 'absolute' like /foo/bar,
  1504. // or 'relative' like '../baz'
  1505. prefix = pattern.slice(0, n).join('/')
  1506. break
  1507. }
  1508. var remain = pattern.slice(n)
  1509. // get the list of entries.
  1510. var read
  1511. if (prefix === null)
  1512. read = '.'
  1513. else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
  1514. if (!prefix || !isAbsolute(prefix))
  1515. prefix = '/' + prefix
  1516. read = prefix
  1517. } else
  1518. read = prefix
  1519. var abs = this._makeAbs(read)
  1520. //if ignored, skip processing
  1521. if (childrenIgnored(this, read))
  1522. return
  1523. var isGlobStar = remain[0] === minimatch.GLOBSTAR
  1524. if (isGlobStar)
  1525. this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
  1526. else
  1527. this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
  1528. }
  1529. GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
  1530. var entries = this._readdir(abs, inGlobStar)
  1531. // if the abs isn't a dir, then nothing can match!
  1532. if (!entries)
  1533. return
  1534. // It will only match dot entries if it starts with a dot, or if
  1535. // dot is set. Stuff like @(.foo|.bar) isn't allowed.
  1536. var pn = remain[0]
  1537. var negate = !!this.minimatch.negate
  1538. var rawGlob = pn._glob
  1539. var dotOk = this.dot || rawGlob.charAt(0) === '.'
  1540. var matchedEntries = []
  1541. for (var i = 0; i < entries.length; i++) {
  1542. var e = entries[i]
  1543. if (e.charAt(0) !== '.' || dotOk) {
  1544. var m
  1545. if (negate && !prefix) {
  1546. m = !e.match(pn)
  1547. } else {
  1548. m = e.match(pn)
  1549. }
  1550. if (m)
  1551. matchedEntries.push(e)
  1552. }
  1553. }
  1554. var len = matchedEntries.length
  1555. // If there are no matched entries, then nothing matches.
  1556. if (len === 0)
  1557. return
  1558. // if this is the last remaining pattern bit, then no need for
  1559. // an additional stat *unless* the user has specified mark or
  1560. // stat explicitly. We know they exist, since readdir returned
  1561. // them.
  1562. if (remain.length === 1 && !this.mark && !this.stat) {
  1563. if (!this.matches[index])
  1564. this.matches[index] = Object.create(null)
  1565. for (var i = 0; i < len; i ++) {
  1566. var e = matchedEntries[i]
  1567. if (prefix) {
  1568. if (prefix.slice(-1) !== '/')
  1569. e = prefix + '/' + e
  1570. else
  1571. e = prefix + e
  1572. }
  1573. if (e.charAt(0) === '/' && !this.nomount) {
  1574. e = path.join(this.root, e)
  1575. }
  1576. this._emitMatch(index, e)
  1577. }
  1578. // This was the last one, and no stats were needed
  1579. return
  1580. }
  1581. // now test all matched entries as stand-ins for that part
  1582. // of the pattern.
  1583. remain.shift()
  1584. for (var i = 0; i < len; i ++) {
  1585. var e = matchedEntries[i]
  1586. var newPattern
  1587. if (prefix)
  1588. newPattern = [prefix, e]
  1589. else
  1590. newPattern = [e]
  1591. this._process(newPattern.concat(remain), index, inGlobStar)
  1592. }
  1593. }
  1594. GlobSync.prototype._emitMatch = function (index, e) {
  1595. if (isIgnored(this, e))
  1596. return
  1597. var abs = this._makeAbs(e)
  1598. if (this.mark)
  1599. e = this._mark(e)
  1600. if (this.absolute) {
  1601. e = abs
  1602. }
  1603. if (this.matches[index][e])
  1604. return
  1605. if (this.nodir) {
  1606. var c = this.cache[abs]
  1607. if (c === 'DIR' || Array.isArray(c))
  1608. return
  1609. }
  1610. this.matches[index][e] = true
  1611. if (this.stat)
  1612. this._stat(e)
  1613. }
  1614. GlobSync.prototype._readdirInGlobStar = function (abs) {
  1615. // follow all symlinked directories forever
  1616. // just proceed as if this is a non-globstar situation
  1617. if (this.follow)
  1618. return this._readdir(abs, false)
  1619. var entries
  1620. var lstat
  1621. var stat
  1622. try {
  1623. lstat = fs.lstatSync(abs)
  1624. } catch (er) {
  1625. if (er.code === 'ENOENT') {
  1626. // lstat failed, doesn't exist
  1627. return null
  1628. }
  1629. }
  1630. var isSym = lstat && lstat.isSymbolicLink()
  1631. this.symlinks[abs] = isSym
  1632. // If it's not a symlink or a dir, then it's definitely a regular file.
  1633. // don't bother doing a readdir in that case.
  1634. if (!isSym && lstat && !lstat.isDirectory())
  1635. this.cache[abs] = 'FILE'
  1636. else
  1637. entries = this._readdir(abs, false)
  1638. return entries
  1639. }
  1640. GlobSync.prototype._readdir = function (abs, inGlobStar) {
  1641. var entries
  1642. if (inGlobStar && !ownProp(this.symlinks, abs))
  1643. return this._readdirInGlobStar(abs)
  1644. if (ownProp(this.cache, abs)) {
  1645. var c = this.cache[abs]
  1646. if (!c || c === 'FILE')
  1647. return null
  1648. if (Array.isArray(c))
  1649. return c
  1650. }
  1651. try {
  1652. return this._readdirEntries(abs, fs.readdirSync(abs))
  1653. } catch (er) {
  1654. this._readdirError(abs, er)
  1655. return null
  1656. }
  1657. }
  1658. GlobSync.prototype._readdirEntries = function (abs, entries) {
  1659. // if we haven't asked to stat everything, then just
  1660. // assume that everything in there exists, so we can avoid
  1661. // having to stat it a second time.
  1662. if (!this.mark && !this.stat) {
  1663. for (var i = 0; i < entries.length; i ++) {
  1664. var e = entries[i]
  1665. if (abs === '/')
  1666. e = abs + e
  1667. else
  1668. e = abs + '/' + e
  1669. this.cache[e] = true
  1670. }
  1671. }
  1672. this.cache[abs] = entries
  1673. // mark and cache dir-ness
  1674. return entries
  1675. }
  1676. GlobSync.prototype._readdirError = function (f, er) {
  1677. // handle errors, and cache the information
  1678. switch (er.code) {
  1679. case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
  1680. case 'ENOTDIR': // totally normal. means it *does* exist.
  1681. var abs = this._makeAbs(f)
  1682. this.cache[abs] = 'FILE'
  1683. if (abs === this.cwdAbs) {
  1684. var error = new Error(er.code + ' invalid cwd ' + this.cwd)
  1685. error.path = this.cwd
  1686. error.code = er.code
  1687. throw error
  1688. }
  1689. break
  1690. case 'ENOENT': // not terribly unusual
  1691. case 'ELOOP':
  1692. case 'ENAMETOOLONG':
  1693. case 'UNKNOWN':
  1694. this.cache[this._makeAbs(f)] = false
  1695. break
  1696. default: // some unusual error. Treat as failure.
  1697. this.cache[this._makeAbs(f)] = false
  1698. if (this.strict)
  1699. throw er
  1700. if (!this.silent)
  1701. console.error('glob error', er)
  1702. break
  1703. }
  1704. }
  1705. GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
  1706. var entries = this._readdir(abs, inGlobStar)
  1707. // no entries means not a dir, so it can never have matches
  1708. // foo.txt/** doesn't match foo.txt
  1709. if (!entries)
  1710. return
  1711. // test without the globstar, and with every child both below
  1712. // and replacing the globstar.
  1713. var remainWithoutGlobStar = remain.slice(1)
  1714. var gspref = prefix ? [ prefix ] : []
  1715. var noGlobStar = gspref.concat(remainWithoutGlobStar)
  1716. // the noGlobStar pattern exits the inGlobStar state
  1717. this._process(noGlobStar, index, false)
  1718. var len = entries.length
  1719. var isSym = this.symlinks[abs]
  1720. // If it's a symlink, and we're in a globstar, then stop
  1721. if (isSym && inGlobStar)
  1722. return
  1723. for (var i = 0; i < len; i++) {
  1724. var e = entries[i]
  1725. if (e.charAt(0) === '.' && !this.dot)
  1726. continue
  1727. // these two cases enter the inGlobStar state
  1728. var instead = gspref.concat(entries[i], remainWithoutGlobStar)
  1729. this._process(instead, index, true)
  1730. var below = gspref.concat(entries[i], remain)
  1731. this._process(below, index, true)
  1732. }
  1733. }
  1734. GlobSync.prototype._processSimple = function (prefix, index) {
  1735. // XXX review this. Shouldn't it be doing the mounting etc
  1736. // before doing stat? kinda weird?
  1737. var exists = this._stat(prefix)
  1738. if (!this.matches[index])
  1739. this.matches[index] = Object.create(null)
  1740. // If it doesn't exist, then just mark the lack of results
  1741. if (!exists)
  1742. return
  1743. if (prefix && isAbsolute(prefix) && !this.nomount) {
  1744. var trail = /[\/\\]$/.test(prefix)
  1745. if (prefix.charAt(0) === '/') {
  1746. prefix = path.join(this.root, prefix)
  1747. } else {
  1748. prefix = path.resolve(this.root, prefix)
  1749. if (trail)
  1750. prefix += '/'
  1751. }
  1752. }
  1753. if (process.platform === 'win32')
  1754. prefix = prefix.replace(/\\/g, '/')
  1755. // Mark this as a match
  1756. this._emitMatch(index, prefix)
  1757. }
  1758. // Returns either 'DIR', 'FILE', or false
  1759. GlobSync.prototype._stat = function (f) {
  1760. var abs = this._makeAbs(f)
  1761. var needDir = f.slice(-1) === '/'
  1762. if (f.length > this.maxLength)
  1763. return false
  1764. if (!this.stat && ownProp(this.cache, abs)) {
  1765. var c = this.cache[abs]
  1766. if (Array.isArray(c))
  1767. c = 'DIR'
  1768. // It exists, but maybe not how we need it
  1769. if (!needDir || c === 'DIR')
  1770. return c
  1771. if (needDir && c === 'FILE')
  1772. return false
  1773. // otherwise we have to stat, because maybe c=true
  1774. // if we know it exists, but not what it is.
  1775. }
  1776. var exists
  1777. var stat = this.statCache[abs]
  1778. if (!stat) {
  1779. var lstat
  1780. try {
  1781. lstat = fs.lstatSync(abs)
  1782. } catch (er) {
  1783. if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
  1784. this.statCache[abs] = false
  1785. return false
  1786. }
  1787. }
  1788. if (lstat && lstat.isSymbolicLink()) {
  1789. try {
  1790. stat = fs.statSync(abs)
  1791. } catch (er) {
  1792. stat = lstat
  1793. }
  1794. } else {
  1795. stat = lstat
  1796. }
  1797. }
  1798. this.statCache[abs] = stat
  1799. var c = true
  1800. if (stat)
  1801. c = stat.isDirectory() ? 'DIR' : 'FILE'
  1802. this.cache[abs] = this.cache[abs] || c
  1803. if (needDir && c === 'FILE')
  1804. return false
  1805. return c
  1806. }
  1807. GlobSync.prototype._mark = function (p) {
  1808. return common.mark(this, p)
  1809. }
  1810. GlobSync.prototype._makeAbs = function (f) {
  1811. return common.makeAbs(this, f)
  1812. }
  1813. /***/ }),
  1814. /***/ 67844:
  1815. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1816. var wrappy = __webpack_require__(52479)
  1817. var reqs = Object.create(null)
  1818. var once = __webpack_require__(30778)
  1819. module.exports = wrappy(inflight)
  1820. function inflight (key, cb) {
  1821. if (reqs[key]) {
  1822. reqs[key].push(cb)
  1823. return null
  1824. } else {
  1825. reqs[key] = [cb]
  1826. return makeres(key)
  1827. }
  1828. }
  1829. function makeres (key) {
  1830. return once(function RES () {
  1831. var cbs = reqs[key]
  1832. var len = cbs.length
  1833. var args = slice(arguments)
  1834. // XXX It's somewhat ambiguous whether a new callback added in this
  1835. // pass should be queued for later execution if something in the
  1836. // list of callbacks throws, or if it should just be discarded.
  1837. // However, it's such an edge case that it hardly matters, and either
  1838. // choice is likely as surprising as the other.
  1839. // As it happens, we do go ahead and schedule it for later execution.
  1840. try {
  1841. for (var i = 0; i < len; i++) {
  1842. cbs[i].apply(null, args)
  1843. }
  1844. } finally {
  1845. if (cbs.length > len) {
  1846. // added more in the interim.
  1847. // de-zalgo, just in case, but don't call again.
  1848. cbs.splice(0, len)
  1849. process.nextTick(function () {
  1850. RES.apply(null, args)
  1851. })
  1852. } else {
  1853. delete reqs[key]
  1854. }
  1855. }
  1856. })
  1857. }
  1858. function slice (args) {
  1859. var length = args.length
  1860. var array = []
  1861. for (var i = 0; i < length; i++) array[i] = args[i]
  1862. return array
  1863. }
  1864. /***/ }),
  1865. /***/ 5800:
  1866. /***/ ((module) => {
  1867. /**
  1868. * lodash (Custom Build) <https://lodash.com/>
  1869. * Build: `lodash modularize exports="npm" -o ./`
  1870. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1871. * Released under MIT license <https://lodash.com/license>
  1872. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1873. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1874. */
  1875. /** Used as references for various `Number` constants. */
  1876. var MAX_SAFE_INTEGER = 9007199254740991;
  1877. /** `Object#toString` result references. */
  1878. var argsTag = '[object Arguments]',
  1879. funcTag = '[object Function]',
  1880. genTag = '[object GeneratorFunction]';
  1881. /** Detect free variable `global` from Node.js. */
  1882. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1883. /** Detect free variable `self`. */
  1884. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1885. /** Used as a reference to the global object. */
  1886. var root = freeGlobal || freeSelf || Function('return this')();
  1887. /**
  1888. * Appends the elements of `values` to `array`.
  1889. *
  1890. * @private
  1891. * @param {Array} array The array to modify.
  1892. * @param {Array} values The values to append.
  1893. * @returns {Array} Returns `array`.
  1894. */
  1895. function arrayPush(array, values) {
  1896. var index = -1,
  1897. length = values.length,
  1898. offset = array.length;
  1899. while (++index < length) {
  1900. array[offset + index] = values[index];
  1901. }
  1902. return array;
  1903. }
  1904. /** Used for built-in method references. */
  1905. var objectProto = Object.prototype;
  1906. /** Used to check objects for own properties. */
  1907. var hasOwnProperty = objectProto.hasOwnProperty;
  1908. /**
  1909. * Used to resolve the
  1910. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1911. * of values.
  1912. */
  1913. var objectToString = objectProto.toString;
  1914. /** Built-in value references. */
  1915. var Symbol = root.Symbol,
  1916. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  1917. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
  1918. /**
  1919. * The base implementation of `_.flatten` with support for restricting flattening.
  1920. *
  1921. * @private
  1922. * @param {Array} array The array to flatten.
  1923. * @param {number} depth The maximum recursion depth.
  1924. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  1925. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  1926. * @param {Array} [result=[]] The initial result value.
  1927. * @returns {Array} Returns the new flattened array.
  1928. */
  1929. function baseFlatten(array, depth, predicate, isStrict, result) {
  1930. var index = -1,
  1931. length = array.length;
  1932. predicate || (predicate = isFlattenable);
  1933. result || (result = []);
  1934. while (++index < length) {
  1935. var value = array[index];
  1936. if (depth > 0 && predicate(value)) {
  1937. if (depth > 1) {
  1938. // Recursively flatten arrays (susceptible to call stack limits).
  1939. baseFlatten(value, depth - 1, predicate, isStrict, result);
  1940. } else {
  1941. arrayPush(result, value);
  1942. }
  1943. } else if (!isStrict) {
  1944. result[result.length] = value;
  1945. }
  1946. }
  1947. return result;
  1948. }
  1949. /**
  1950. * Checks if `value` is a flattenable `arguments` object or array.
  1951. *
  1952. * @private
  1953. * @param {*} value The value to check.
  1954. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  1955. */
  1956. function isFlattenable(value) {
  1957. return isArray(value) || isArguments(value) ||
  1958. !!(spreadableSymbol && value && value[spreadableSymbol]);
  1959. }
  1960. /**
  1961. * Flattens `array` a single level deep.
  1962. *
  1963. * @static
  1964. * @memberOf _
  1965. * @since 0.1.0
  1966. * @category Array
  1967. * @param {Array} array The array to flatten.
  1968. * @returns {Array} Returns the new flattened array.
  1969. * @example
  1970. *
  1971. * _.flatten([1, [2, [3, [4]], 5]]);
  1972. * // => [1, 2, [3, [4]], 5]
  1973. */
  1974. function flatten(array) {
  1975. var length = array ? array.length : 0;
  1976. return length ? baseFlatten(array, 1) : [];
  1977. }
  1978. /**
  1979. * Checks if `value` is likely an `arguments` object.
  1980. *
  1981. * @static
  1982. * @memberOf _
  1983. * @since 0.1.0
  1984. * @category Lang
  1985. * @param {*} value The value to check.
  1986. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  1987. * else `false`.
  1988. * @example
  1989. *
  1990. * _.isArguments(function() { return arguments; }());
  1991. * // => true
  1992. *
  1993. * _.isArguments([1, 2, 3]);
  1994. * // => false
  1995. */
  1996. function isArguments(value) {
  1997. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  1998. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
  1999. (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  2000. }
  2001. /**
  2002. * Checks if `value` is classified as an `Array` object.
  2003. *
  2004. * @static
  2005. * @memberOf _
  2006. * @since 0.1.0
  2007. * @category Lang
  2008. * @param {*} value The value to check.
  2009. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  2010. * @example
  2011. *
  2012. * _.isArray([1, 2, 3]);
  2013. * // => true
  2014. *
  2015. * _.isArray(document.body.children);
  2016. * // => false
  2017. *
  2018. * _.isArray('abc');
  2019. * // => false
  2020. *
  2021. * _.isArray(_.noop);
  2022. * // => false
  2023. */
  2024. var isArray = Array.isArray;
  2025. /**
  2026. * Checks if `value` is array-like. A value is considered array-like if it's
  2027. * not a function and has a `value.length` that's an integer greater than or
  2028. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  2029. *
  2030. * @static
  2031. * @memberOf _
  2032. * @since 4.0.0
  2033. * @category Lang
  2034. * @param {*} value The value to check.
  2035. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  2036. * @example
  2037. *
  2038. * _.isArrayLike([1, 2, 3]);
  2039. * // => true
  2040. *
  2041. * _.isArrayLike(document.body.children);
  2042. * // => true
  2043. *
  2044. * _.isArrayLike('abc');
  2045. * // => true
  2046. *
  2047. * _.isArrayLike(_.noop);
  2048. * // => false
  2049. */
  2050. function isArrayLike(value) {
  2051. return value != null && isLength(value.length) && !isFunction(value);
  2052. }
  2053. /**
  2054. * This method is like `_.isArrayLike` except that it also checks if `value`
  2055. * is an object.
  2056. *
  2057. * @static
  2058. * @memberOf _
  2059. * @since 4.0.0
  2060. * @category Lang
  2061. * @param {*} value The value to check.
  2062. * @returns {boolean} Returns `true` if `value` is an array-like object,
  2063. * else `false`.
  2064. * @example
  2065. *
  2066. * _.isArrayLikeObject([1, 2, 3]);
  2067. * // => true
  2068. *
  2069. * _.isArrayLikeObject(document.body.children);
  2070. * // => true
  2071. *
  2072. * _.isArrayLikeObject('abc');
  2073. * // => false
  2074. *
  2075. * _.isArrayLikeObject(_.noop);
  2076. * // => false
  2077. */
  2078. function isArrayLikeObject(value) {
  2079. return isObjectLike(value) && isArrayLike(value);
  2080. }
  2081. /**
  2082. * Checks if `value` is classified as a `Function` object.
  2083. *
  2084. * @static
  2085. * @memberOf _
  2086. * @since 0.1.0
  2087. * @category Lang
  2088. * @param {*} value The value to check.
  2089. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  2090. * @example
  2091. *
  2092. * _.isFunction(_);
  2093. * // => true
  2094. *
  2095. * _.isFunction(/abc/);
  2096. * // => false
  2097. */
  2098. function isFunction(value) {
  2099. // The use of `Object#toString` avoids issues with the `typeof` operator
  2100. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  2101. var tag = isObject(value) ? objectToString.call(value) : '';
  2102. return tag == funcTag || tag == genTag;
  2103. }
  2104. /**
  2105. * Checks if `value` is a valid array-like length.
  2106. *
  2107. * **Note:** This method is loosely based on
  2108. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  2109. *
  2110. * @static
  2111. * @memberOf _
  2112. * @since 4.0.0
  2113. * @category Lang
  2114. * @param {*} value The value to check.
  2115. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  2116. * @example
  2117. *
  2118. * _.isLength(3);
  2119. * // => true
  2120. *
  2121. * _.isLength(Number.MIN_VALUE);
  2122. * // => false
  2123. *
  2124. * _.isLength(Infinity);
  2125. * // => false
  2126. *
  2127. * _.isLength('3');
  2128. * // => false
  2129. */
  2130. function isLength(value) {
  2131. return typeof value == 'number' &&
  2132. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  2133. }
  2134. /**
  2135. * Checks if `value` is the
  2136. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  2137. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  2138. *
  2139. * @static
  2140. * @memberOf _
  2141. * @since 0.1.0
  2142. * @category Lang
  2143. * @param {*} value The value to check.
  2144. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  2145. * @example
  2146. *
  2147. * _.isObject({});
  2148. * // => true
  2149. *
  2150. * _.isObject([1, 2, 3]);
  2151. * // => true
  2152. *
  2153. * _.isObject(_.noop);
  2154. * // => true
  2155. *
  2156. * _.isObject(null);
  2157. * // => false
  2158. */
  2159. function isObject(value) {
  2160. var type = typeof value;
  2161. return !!value && (type == 'object' || type == 'function');
  2162. }
  2163. /**
  2164. * Checks if `value` is object-like. A value is object-like if it's not `null`
  2165. * and has a `typeof` result of "object".
  2166. *
  2167. * @static
  2168. * @memberOf _
  2169. * @since 4.0.0
  2170. * @category Lang
  2171. * @param {*} value The value to check.
  2172. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  2173. * @example
  2174. *
  2175. * _.isObjectLike({});
  2176. * // => true
  2177. *
  2178. * _.isObjectLike([1, 2, 3]);
  2179. * // => true
  2180. *
  2181. * _.isObjectLike(_.noop);
  2182. * // => false
  2183. *
  2184. * _.isObjectLike(null);
  2185. * // => false
  2186. */
  2187. function isObjectLike(value) {
  2188. return !!value && typeof value == 'object';
  2189. }
  2190. module.exports = flatten;
  2191. /***/ }),
  2192. /***/ 91171:
  2193. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2194. module.exports = minimatch
  2195. minimatch.Minimatch = Minimatch
  2196. var path = { sep: '/' }
  2197. try {
  2198. path = __webpack_require__(85622)
  2199. } catch (er) {}
  2200. var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
  2201. var expand = __webpack_require__(3644)
  2202. var plTypes = {
  2203. '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
  2204. '?': { open: '(?:', close: ')?' },
  2205. '+': { open: '(?:', close: ')+' },
  2206. '*': { open: '(?:', close: ')*' },
  2207. '@': { open: '(?:', close: ')' }
  2208. }
  2209. // any single thing other than /
  2210. // don't need to escape / when using new RegExp()
  2211. var qmark = '[^/]'
  2212. // * => any number of characters
  2213. var star = qmark + '*?'
  2214. // ** when dots are allowed. Anything goes, except .. and .
  2215. // not (^ or / followed by one or two dots followed by $ or /),
  2216. // followed by anything, any number of times.
  2217. var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'
  2218. // not a ^ or / followed by a dot,
  2219. // followed by anything, any number of times.
  2220. var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'
  2221. // characters that need to be escaped in RegExp.
  2222. var reSpecials = charSet('().*{}+?[]^$\\!')
  2223. // "abc" -> { a:true, b:true, c:true }
  2224. function charSet (s) {
  2225. return s.split('').reduce(function (set, c) {
  2226. set[c] = true
  2227. return set
  2228. }, {})
  2229. }
  2230. // normalizes slashes.
  2231. var slashSplit = /\/+/
  2232. minimatch.filter = filter
  2233. function filter (pattern, options) {
  2234. options = options || {}
  2235. return function (p, i, list) {
  2236. return minimatch(p, pattern, options)
  2237. }
  2238. }
  2239. function ext (a, b) {
  2240. a = a || {}
  2241. b = b || {}
  2242. var t = {}
  2243. Object.keys(b).forEach(function (k) {
  2244. t[k] = b[k]
  2245. })
  2246. Object.keys(a).forEach(function (k) {
  2247. t[k] = a[k]
  2248. })
  2249. return t
  2250. }
  2251. minimatch.defaults = function (def) {
  2252. if (!def || !Object.keys(def).length) return minimatch
  2253. var orig = minimatch
  2254. var m = function minimatch (p, pattern, options) {
  2255. return orig.minimatch(p, pattern, ext(def, options))
  2256. }
  2257. m.Minimatch = function Minimatch (pattern, options) {
  2258. return new orig.Minimatch(pattern, ext(def, options))
  2259. }
  2260. return m
  2261. }
  2262. Minimatch.defaults = function (def) {
  2263. if (!def || !Object.keys(def).length) return Minimatch
  2264. return minimatch.defaults(def).Minimatch
  2265. }
  2266. function minimatch (p, pattern, options) {
  2267. if (typeof pattern !== 'string') {
  2268. throw new TypeError('glob pattern string required')
  2269. }
  2270. if (!options) options = {}
  2271. // shortcut: comments match nothing.
  2272. if (!options.nocomment && pattern.charAt(0) === '#') {
  2273. return false
  2274. }
  2275. // "" only matches ""
  2276. if (pattern.trim() === '') return p === ''
  2277. return new Minimatch(pattern, options).match(p)
  2278. }
  2279. function Minimatch (pattern, options) {
  2280. if (!(this instanceof Minimatch)) {
  2281. return new Minimatch(pattern, options)
  2282. }
  2283. if (typeof pattern !== 'string') {
  2284. throw new TypeError('glob pattern string required')
  2285. }
  2286. if (!options) options = {}
  2287. pattern = pattern.trim()
  2288. // windows support: need to use /, not \
  2289. if (path.sep !== '/') {
  2290. pattern = pattern.split(path.sep).join('/')
  2291. }
  2292. this.options = options
  2293. this.set = []
  2294. this.pattern = pattern
  2295. this.regexp = null
  2296. this.negate = false
  2297. this.comment = false
  2298. this.empty = false
  2299. // make the set of regexps etc.
  2300. this.make()
  2301. }
  2302. Minimatch.prototype.debug = function () {}
  2303. Minimatch.prototype.make = make
  2304. function make () {
  2305. // don't do it more than once.
  2306. if (this._made) return
  2307. var pattern = this.pattern
  2308. var options = this.options
  2309. // empty patterns and comments match nothing.
  2310. if (!options.nocomment && pattern.charAt(0) === '#') {
  2311. this.comment = true
  2312. return
  2313. }
  2314. if (!pattern) {
  2315. this.empty = true
  2316. return
  2317. }
  2318. // step 1: figure out negation, etc.
  2319. this.parseNegate()
  2320. // step 2: expand braces
  2321. var set = this.globSet = this.braceExpand()
  2322. if (options.debug) this.debug = console.error
  2323. this.debug(this.pattern, set)
  2324. // step 3: now we have a set, so turn each one into a series of path-portion
  2325. // matching patterns.
  2326. // These will be regexps, except in the case of "**", which is
  2327. // set to the GLOBSTAR object for globstar behavior,
  2328. // and will not contain any / characters
  2329. set = this.globParts = set.map(function (s) {
  2330. return s.split(slashSplit)
  2331. })
  2332. this.debug(this.pattern, set)
  2333. // glob --> regexps
  2334. set = set.map(function (s, si, set) {
  2335. return s.map(this.parse, this)
  2336. }, this)
  2337. this.debug(this.pattern, set)
  2338. // filter out everything that didn't compile properly.
  2339. set = set.filter(function (s) {
  2340. return s.indexOf(false) === -1
  2341. })
  2342. this.debug(this.pattern, set)
  2343. this.set = set
  2344. }
  2345. Minimatch.prototype.parseNegate = parseNegate
  2346. function parseNegate () {
  2347. var pattern = this.pattern
  2348. var negate = false
  2349. var options = this.options
  2350. var negateOffset = 0
  2351. if (options.nonegate) return
  2352. for (var i = 0, l = pattern.length
  2353. ; i < l && pattern.charAt(i) === '!'
  2354. ; i++) {
  2355. negate = !negate
  2356. negateOffset++
  2357. }
  2358. if (negateOffset) this.pattern = pattern.substr(negateOffset)
  2359. this.negate = negate
  2360. }
  2361. // Brace expansion:
  2362. // a{b,c}d -> abd acd
  2363. // a{b,}c -> abc ac
  2364. // a{0..3}d -> a0d a1d a2d a3d
  2365. // a{b,c{d,e}f}g -> abg acdfg acefg
  2366. // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
  2367. //
  2368. // Invalid sets are not expanded.
  2369. // a{2..}b -> a{2..}b
  2370. // a{b}c -> a{b}c
  2371. minimatch.braceExpand = function (pattern, options) {
  2372. return braceExpand(pattern, options)
  2373. }
  2374. Minimatch.prototype.braceExpand = braceExpand
  2375. function braceExpand (pattern, options) {
  2376. if (!options) {
  2377. if (this instanceof Minimatch) {
  2378. options = this.options
  2379. } else {
  2380. options = {}
  2381. }
  2382. }
  2383. pattern = typeof pattern === 'undefined'
  2384. ? this.pattern : pattern
  2385. if (typeof pattern === 'undefined') {
  2386. throw new TypeError('undefined pattern')
  2387. }
  2388. if (options.nobrace ||
  2389. !pattern.match(/\{.*\}/)) {
  2390. // shortcut. no need to expand.
  2391. return [pattern]
  2392. }
  2393. return expand(pattern)
  2394. }
  2395. // parse a component of the expanded set.
  2396. // At this point, no pattern may contain "/" in it
  2397. // so we're going to return a 2d array, where each entry is the full
  2398. // pattern, split on '/', and then turned into a regular expression.
  2399. // A regexp is made at the end which joins each array with an
  2400. // escaped /, and another full one which joins each regexp with |.
  2401. //
  2402. // Following the lead of Bash 4.1, note that "**" only has special meaning
  2403. // when it is the *only* thing in a path portion. Otherwise, any series
  2404. // of * is equivalent to a single *. Globstar behavior is enabled by
  2405. // default, and can be disabled by setting options.noglobstar.
  2406. Minimatch.prototype.parse = parse
  2407. var SUBPARSE = {}
  2408. function parse (pattern, isSub) {
  2409. if (pattern.length > 1024 * 64) {
  2410. throw new TypeError('pattern is too long')
  2411. }
  2412. var options = this.options
  2413. // shortcuts
  2414. if (!options.noglobstar && pattern === '**') return GLOBSTAR
  2415. if (pattern === '') return ''
  2416. var re = ''
  2417. var hasMagic = !!options.nocase
  2418. var escaping = false
  2419. // ? => one single character
  2420. var patternListStack = []
  2421. var negativeLists = []
  2422. var stateChar
  2423. var inClass = false
  2424. var reClassStart = -1
  2425. var classStart = -1
  2426. // . and .. never match anything that doesn't start with .,
  2427. // even when options.dot is set.
  2428. var patternStart = pattern.charAt(0) === '.' ? '' // anything
  2429. // not (start or / followed by . or .. followed by / or end)
  2430. : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
  2431. : '(?!\\.)'
  2432. var self = this
  2433. function clearStateChar () {
  2434. if (stateChar) {
  2435. // we had some state-tracking character
  2436. // that wasn't consumed by this pass.
  2437. switch (stateChar) {
  2438. case '*':
  2439. re += star
  2440. hasMagic = true
  2441. break
  2442. case '?':
  2443. re += qmark
  2444. hasMagic = true
  2445. break
  2446. default:
  2447. re += '\\' + stateChar
  2448. break
  2449. }
  2450. self.debug('clearStateChar %j %j', stateChar, re)
  2451. stateChar = false
  2452. }
  2453. }
  2454. for (var i = 0, len = pattern.length, c
  2455. ; (i < len) && (c = pattern.charAt(i))
  2456. ; i++) {
  2457. this.debug('%s\t%s %s %j', pattern, i, re, c)
  2458. // skip over any that are escaped.
  2459. if (escaping && reSpecials[c]) {
  2460. re += '\\' + c
  2461. escaping = false
  2462. continue
  2463. }
  2464. switch (c) {
  2465. case '/':
  2466. // completely not allowed, even escaped.
  2467. // Should already be path-split by now.
  2468. return false
  2469. case '\\':
  2470. clearStateChar()
  2471. escaping = true
  2472. continue
  2473. // the various stateChar values
  2474. // for the "extglob" stuff.
  2475. case '?':
  2476. case '*':
  2477. case '+':
  2478. case '@':
  2479. case '!':
  2480. this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
  2481. // all of those are literals inside a class, except that
  2482. // the glob [!a] means [^a] in regexp
  2483. if (inClass) {
  2484. this.debug(' in class')
  2485. if (c === '!' && i === classStart + 1) c = '^'
  2486. re += c
  2487. continue
  2488. }
  2489. // if we already have a stateChar, then it means
  2490. // that there was something like ** or +? in there.
  2491. // Handle the stateChar, then proceed with this one.
  2492. self.debug('call clearStateChar %j', stateChar)
  2493. clearStateChar()
  2494. stateChar = c
  2495. // if extglob is disabled, then +(asdf|foo) isn't a thing.
  2496. // just clear the statechar *now*, rather than even diving into
  2497. // the patternList stuff.
  2498. if (options.noext) clearStateChar()
  2499. continue
  2500. case '(':
  2501. if (inClass) {
  2502. re += '('
  2503. continue
  2504. }
  2505. if (!stateChar) {
  2506. re += '\\('
  2507. continue
  2508. }
  2509. patternListStack.push({
  2510. type: stateChar,
  2511. start: i - 1,
  2512. reStart: re.length,
  2513. open: plTypes[stateChar].open,
  2514. close: plTypes[stateChar].close
  2515. })
  2516. // negation is (?:(?!js)[^/]*)
  2517. re += stateChar === '!' ? '(?:(?!(?:' : '(?:'
  2518. this.debug('plType %j %j', stateChar, re)
  2519. stateChar = false
  2520. continue
  2521. case ')':
  2522. if (inClass || !patternListStack.length) {
  2523. re += '\\)'
  2524. continue
  2525. }
  2526. clearStateChar()
  2527. hasMagic = true
  2528. var pl = patternListStack.pop()
  2529. // negation is (?:(?!js)[^/]*)
  2530. // The others are (?:<pattern>)<type>
  2531. re += pl.close
  2532. if (pl.type === '!') {
  2533. negativeLists.push(pl)
  2534. }
  2535. pl.reEnd = re.length
  2536. continue
  2537. case '|':
  2538. if (inClass || !patternListStack.length || escaping) {
  2539. re += '\\|'
  2540. escaping = false
  2541. continue
  2542. }
  2543. clearStateChar()
  2544. re += '|'
  2545. continue
  2546. // these are mostly the same in regexp and glob
  2547. case '[':
  2548. // swallow any state-tracking char before the [
  2549. clearStateChar()
  2550. if (inClass) {
  2551. re += '\\' + c
  2552. continue
  2553. }
  2554. inClass = true
  2555. classStart = i
  2556. reClassStart = re.length
  2557. re += c
  2558. continue
  2559. case ']':
  2560. // a right bracket shall lose its special
  2561. // meaning and represent itself in
  2562. // a bracket expression if it occurs
  2563. // first in the list. -- POSIX.2 2.8.3.2
  2564. if (i === classStart + 1 || !inClass) {
  2565. re += '\\' + c
  2566. escaping = false
  2567. continue
  2568. }
  2569. // handle the case where we left a class open.
  2570. // "[z-a]" is valid, equivalent to "\[z-a\]"
  2571. if (inClass) {
  2572. // split where the last [ was, make sure we don't have
  2573. // an invalid re. if so, re-walk the contents of the
  2574. // would-be class to re-translate any characters that
  2575. // were passed through as-is
  2576. // TODO: It would probably be faster to determine this
  2577. // without a try/catch and a new RegExp, but it's tricky
  2578. // to do safely. For now, this is safe and works.
  2579. var cs = pattern.substring(classStart + 1, i)
  2580. try {
  2581. RegExp('[' + cs + ']')
  2582. } catch (er) {
  2583. // not a valid class!
  2584. var sp = this.parse(cs, SUBPARSE)
  2585. re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
  2586. hasMagic = hasMagic || sp[1]
  2587. inClass = false
  2588. continue
  2589. }
  2590. }
  2591. // finish up the class.
  2592. hasMagic = true
  2593. inClass = false
  2594. re += c
  2595. continue
  2596. default:
  2597. // swallow any state char that wasn't consumed
  2598. clearStateChar()
  2599. if (escaping) {
  2600. // no need
  2601. escaping = false
  2602. } else if (reSpecials[c]
  2603. && !(c === '^' && inClass)) {
  2604. re += '\\'
  2605. }
  2606. re += c
  2607. } // switch
  2608. } // for
  2609. // handle the case where we left a class open.
  2610. // "[abc" is valid, equivalent to "\[abc"
  2611. if (inClass) {
  2612. // split where the last [ was, and escape it
  2613. // this is a huge pita. We now have to re-walk
  2614. // the contents of the would-be class to re-translate
  2615. // any characters that were passed through as-is
  2616. cs = pattern.substr(classStart + 1)
  2617. sp = this.parse(cs, SUBPARSE)
  2618. re = re.substr(0, reClassStart) + '\\[' + sp[0]
  2619. hasMagic = hasMagic || sp[1]
  2620. }
  2621. // handle the case where we had a +( thing at the *end*
  2622. // of the pattern.
  2623. // each pattern list stack adds 3 chars, and we need to go through
  2624. // and escape any | chars that were passed through as-is for the regexp.
  2625. // Go through and escape them, taking care not to double-escape any
  2626. // | chars that were already escaped.
  2627. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
  2628. var tail = re.slice(pl.reStart + pl.open.length)
  2629. this.debug('setting tail', re, pl)
  2630. // maybe some even number of \, then maybe 1 \, followed by a |
  2631. tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
  2632. if (!$2) {
  2633. // the | isn't already escaped, so escape it.
  2634. $2 = '\\'
  2635. }
  2636. // need to escape all those slashes *again*, without escaping the
  2637. // one that we need for escaping the | character. As it works out,
  2638. // escaping an even number of slashes can be done by simply repeating
  2639. // it exactly after itself. That's why this trick works.
  2640. //
  2641. // I am sorry that you have to see this.
  2642. return $1 + $1 + $2 + '|'
  2643. })
  2644. this.debug('tail=%j\n %s', tail, tail, pl, re)
  2645. var t = pl.type === '*' ? star
  2646. : pl.type === '?' ? qmark
  2647. : '\\' + pl.type
  2648. hasMagic = true
  2649. re = re.slice(0, pl.reStart) + t + '\\(' + tail
  2650. }
  2651. // handle trailing things that only matter at the very end.
  2652. clearStateChar()
  2653. if (escaping) {
  2654. // trailing \\
  2655. re += '\\\\'
  2656. }
  2657. // only need to apply the nodot start if the re starts with
  2658. // something that could conceivably capture a dot
  2659. var addPatternStart = false
  2660. switch (re.charAt(0)) {
  2661. case '.':
  2662. case '[':
  2663. case '(': addPatternStart = true
  2664. }
  2665. // Hack to work around lack of negative lookbehind in JS
  2666. // A pattern like: *.!(x).!(y|z) needs to ensure that a name
  2667. // like 'a.xyz.yz' doesn't match. So, the first negative
  2668. // lookahead, has to look ALL the way ahead, to the end of
  2669. // the pattern.
  2670. for (var n = negativeLists.length - 1; n > -1; n--) {
  2671. var nl = negativeLists[n]
  2672. var nlBefore = re.slice(0, nl.reStart)
  2673. var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
  2674. var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)
  2675. var nlAfter = re.slice(nl.reEnd)
  2676. nlLast += nlAfter
  2677. // Handle nested stuff like *(*.js|!(*.json)), where open parens
  2678. // mean that we should *not* include the ) in the bit that is considered
  2679. // "after" the negated section.
  2680. var openParensBefore = nlBefore.split('(').length - 1
  2681. var cleanAfter = nlAfter
  2682. for (i = 0; i < openParensBefore; i++) {
  2683. cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
  2684. }
  2685. nlAfter = cleanAfter
  2686. var dollar = ''
  2687. if (nlAfter === '' && isSub !== SUBPARSE) {
  2688. dollar = '$'
  2689. }
  2690. var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast
  2691. re = newRe
  2692. }
  2693. // if the re is not "" at this point, then we need to make sure
  2694. // it doesn't match against an empty path part.
  2695. // Otherwise a/* will match a/, which it should not.
  2696. if (re !== '' && hasMagic) {
  2697. re = '(?=.)' + re
  2698. }
  2699. if (addPatternStart) {
  2700. re = patternStart + re
  2701. }
  2702. // parsing just a piece of a larger pattern.
  2703. if (isSub === SUBPARSE) {
  2704. return [re, hasMagic]
  2705. }
  2706. // skip the regexp for non-magical patterns
  2707. // unescape anything in it, though, so that it'll be
  2708. // an exact match against a file etc.
  2709. if (!hasMagic) {
  2710. return globUnescape(pattern)
  2711. }
  2712. var flags = options.nocase ? 'i' : ''
  2713. try {
  2714. var regExp = new RegExp('^' + re + '$', flags)
  2715. } catch (er) {
  2716. // If it was an invalid regular expression, then it can't match
  2717. // anything. This trick looks for a character after the end of
  2718. // the string, which is of course impossible, except in multi-line
  2719. // mode, but it's not a /m regex.
  2720. return new RegExp('$.')
  2721. }
  2722. regExp._glob = pattern
  2723. regExp._src = re
  2724. return regExp
  2725. }
  2726. minimatch.makeRe = function (pattern, options) {
  2727. return new Minimatch(pattern, options || {}).makeRe()
  2728. }
  2729. Minimatch.prototype.makeRe = makeRe
  2730. function makeRe () {
  2731. if (this.regexp || this.regexp === false) return this.regexp
  2732. // at this point, this.set is a 2d array of partial
  2733. // pattern strings, or "**".
  2734. //
  2735. // It's better to use .match(). This function shouldn't
  2736. // be used, really, but it's pretty convenient sometimes,
  2737. // when you just want to work with a regex.
  2738. var set = this.set
  2739. if (!set.length) {
  2740. this.regexp = false
  2741. return this.regexp
  2742. }
  2743. var options = this.options
  2744. var twoStar = options.noglobstar ? star
  2745. : options.dot ? twoStarDot
  2746. : twoStarNoDot
  2747. var flags = options.nocase ? 'i' : ''
  2748. var re = set.map(function (pattern) {
  2749. return pattern.map(function (p) {
  2750. return (p === GLOBSTAR) ? twoStar
  2751. : (typeof p === 'string') ? regExpEscape(p)
  2752. : p._src
  2753. }).join('\\\/')
  2754. }).join('|')
  2755. // must match entire pattern
  2756. // ending in a * or ** will make it less strict.
  2757. re = '^(?:' + re + ')$'
  2758. // can match anything, as long as it's not this.
  2759. if (this.negate) re = '^(?!' + re + ').*$'
  2760. try {
  2761. this.regexp = new RegExp(re, flags)
  2762. } catch (ex) {
  2763. this.regexp = false
  2764. }
  2765. return this.regexp
  2766. }
  2767. minimatch.match = function (list, pattern, options) {
  2768. options = options || {}
  2769. var mm = new Minimatch(pattern, options)
  2770. list = list.filter(function (f) {
  2771. return mm.match(f)
  2772. })
  2773. if (mm.options.nonull && !list.length) {
  2774. list.push(pattern)
  2775. }
  2776. return list
  2777. }
  2778. Minimatch.prototype.match = match
  2779. function match (f, partial) {
  2780. this.debug('match', f, this.pattern)
  2781. // short-circuit in the case of busted things.
  2782. // comments, etc.
  2783. if (this.comment) return false
  2784. if (this.empty) return f === ''
  2785. if (f === '/' && partial) return true
  2786. var options = this.options
  2787. // windows: need to use /, not \
  2788. if (path.sep !== '/') {
  2789. f = f.split(path.sep).join('/')
  2790. }
  2791. // treat the test path as a set of pathparts.
  2792. f = f.split(slashSplit)
  2793. this.debug(this.pattern, 'split', f)
  2794. // just ONE of the pattern sets in this.set needs to match
  2795. // in order for it to be valid. If negating, then just one
  2796. // match means that we have failed.
  2797. // Either way, return on the first hit.
  2798. var set = this.set
  2799. this.debug(this.pattern, 'set', set)
  2800. // Find the basename of the path by looking for the last non-empty segment
  2801. var filename
  2802. var i
  2803. for (i = f.length - 1; i >= 0; i--) {
  2804. filename = f[i]
  2805. if (filename) break
  2806. }
  2807. for (i = 0; i < set.length; i++) {
  2808. var pattern = set[i]
  2809. var file = f
  2810. if (options.matchBase && pattern.length === 1) {
  2811. file = [filename]
  2812. }
  2813. var hit = this.matchOne(file, pattern, partial)
  2814. if (hit) {
  2815. if (options.flipNegate) return true
  2816. return !this.negate
  2817. }
  2818. }
  2819. // didn't get any hits. this is success if it's a negative
  2820. // pattern, failure otherwise.
  2821. if (options.flipNegate) return false
  2822. return this.negate
  2823. }
  2824. // set partial to true to test if, for example,
  2825. // "/a/b" matches the start of "/*/b/*/d"
  2826. // Partial means, if you run out of file before you run
  2827. // out of pattern, then that's fine, as long as all
  2828. // the parts match.
  2829. Minimatch.prototype.matchOne = function (file, pattern, partial) {
  2830. var options = this.options
  2831. this.debug('matchOne',
  2832. { 'this': this, file: file, pattern: pattern })
  2833. this.debug('matchOne', file.length, pattern.length)
  2834. for (var fi = 0,
  2835. pi = 0,
  2836. fl = file.length,
  2837. pl = pattern.length
  2838. ; (fi < fl) && (pi < pl)
  2839. ; fi++, pi++) {
  2840. this.debug('matchOne loop')
  2841. var p = pattern[pi]
  2842. var f = file[fi]
  2843. this.debug(pattern, p, f)
  2844. // should be impossible.
  2845. // some invalid regexp stuff in the set.
  2846. if (p === false) return false
  2847. if (p === GLOBSTAR) {
  2848. this.debug('GLOBSTAR', [pattern, p, f])
  2849. // "**"
  2850. // a/**/b/**/c would match the following:
  2851. // a/b/x/y/z/c
  2852. // a/x/y/z/b/c
  2853. // a/b/x/b/x/c
  2854. // a/b/c
  2855. // To do this, take the rest of the pattern after
  2856. // the **, and see if it would match the file remainder.
  2857. // If so, return success.
  2858. // If not, the ** "swallows" a segment, and try again.
  2859. // This is recursively awful.
  2860. //
  2861. // a/**/b/**/c matching a/b/x/y/z/c
  2862. // - a matches a
  2863. // - doublestar
  2864. // - matchOne(b/x/y/z/c, b/**/c)
  2865. // - b matches b
  2866. // - doublestar
  2867. // - matchOne(x/y/z/c, c) -> no
  2868. // - matchOne(y/z/c, c) -> no
  2869. // - matchOne(z/c, c) -> no
  2870. // - matchOne(c, c) yes, hit
  2871. var fr = fi
  2872. var pr = pi + 1
  2873. if (pr === pl) {
  2874. this.debug('** at the end')
  2875. // a ** at the end will just swallow the rest.
  2876. // We have found a match.
  2877. // however, it will not swallow /.x, unless
  2878. // options.dot is set.
  2879. // . and .. are *never* matched by **, for explosively
  2880. // exponential reasons.
  2881. for (; fi < fl; fi++) {
  2882. if (file[fi] === '.' || file[fi] === '..' ||
  2883. (!options.dot && file[fi].charAt(0) === '.')) return false
  2884. }
  2885. return true
  2886. }
  2887. // ok, let's see if we can swallow whatever we can.
  2888. while (fr < fl) {
  2889. var swallowee = file[fr]
  2890. this.debug('\nglobstar while', file, fr, pattern, pr, swallowee)
  2891. // XXX remove this slice. Just pass the start index.
  2892. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
  2893. this.debug('globstar found match!', fr, fl, swallowee)
  2894. // found a match.
  2895. return true
  2896. } else {
  2897. // can't swallow "." or ".." ever.
  2898. // can only swallow ".foo" when explicitly asked.
  2899. if (swallowee === '.' || swallowee === '..' ||
  2900. (!options.dot && swallowee.charAt(0) === '.')) {
  2901. this.debug('dot detected!', file, fr, pattern, pr)
  2902. break
  2903. }
  2904. // ** swallows a segment, and continue.
  2905. this.debug('globstar swallow a segment, and continue')
  2906. fr++
  2907. }
  2908. }
  2909. // no match was found.
  2910. // However, in partial mode, we can't say this is necessarily over.
  2911. // If there's more *pattern* left, then
  2912. if (partial) {
  2913. // ran out of file
  2914. this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
  2915. if (fr === fl) return true
  2916. }
  2917. return false
  2918. }
  2919. // something other than **
  2920. // non-magic patterns just have to match exactly
  2921. // patterns with magic have been turned into regexps.
  2922. var hit
  2923. if (typeof p === 'string') {
  2924. if (options.nocase) {
  2925. hit = f.toLowerCase() === p.toLowerCase()
  2926. } else {
  2927. hit = f === p
  2928. }
  2929. this.debug('string match', p, f, hit)
  2930. } else {
  2931. hit = f.match(p)
  2932. this.debug('pattern match', p, f, hit)
  2933. }
  2934. if (!hit) return false
  2935. }
  2936. // Note: ending in / means that we'll get a final ""
  2937. // at the end of the pattern. This can only match a
  2938. // corresponding "" at the end of the file.
  2939. // If the file ends in /, then it can only match a
  2940. // a pattern that ends in /, unless the pattern just
  2941. // doesn't have any more for it. But, a/b/ should *not*
  2942. // match "a/b/*", even though "" matches against the
  2943. // [^/]*? pattern, except in partial mode, where it might
  2944. // simply not be reached yet.
  2945. // However, a/b/ should still satisfy a/*
  2946. // now either we fell off the end of the pattern, or we're done.
  2947. if (fi === fl && pi === pl) {
  2948. // ran out of pattern and filename at the same time.
  2949. // an exact hit!
  2950. return true
  2951. } else if (fi === fl) {
  2952. // ran out of file, but still had pattern left.
  2953. // this is ok if we're doing the match as part of
  2954. // a glob fs traversal.
  2955. return partial
  2956. } else if (pi === pl) {
  2957. // ran out of pattern, still have file left.
  2958. // this is only acceptable if we're on the very last
  2959. // empty segment of a file with a trailing slash.
  2960. // a/* should match a/b/
  2961. var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
  2962. return emptyFileEnd
  2963. }
  2964. // should be unreachable.
  2965. throw new Error('wtf?')
  2966. }
  2967. // replace stuff like \* with *
  2968. function globUnescape (s) {
  2969. return s.replace(/\\(.)/g, '$1')
  2970. }
  2971. function regExpEscape (s) {
  2972. return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
  2973. }
  2974. /***/ }),
  2975. /***/ 64095:
  2976. /***/ ((module) => {
  2977. "use strict";
  2978. function posix(path) {
  2979. return path.charAt(0) === '/';
  2980. }
  2981. function win32(path) {
  2982. // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
  2983. var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
  2984. var result = splitDeviceRe.exec(path);
  2985. var device = result[1] || '';
  2986. var isUnc = Boolean(device && device.charAt(1) !== ':');
  2987. // UNC paths are always absolute
  2988. return Boolean(result[2] || isUnc);
  2989. }
  2990. module.exports = process.platform === 'win32' ? win32 : posix;
  2991. module.exports.posix = posix;
  2992. module.exports.win32 = win32;
  2993. /***/ }),
  2994. /***/ 50984:
  2995. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2996. module.exports = rimraf
  2997. rimraf.sync = rimrafSync
  2998. var assert = __webpack_require__(42357)
  2999. var path = __webpack_require__(85622)
  3000. var fs = __webpack_require__(35747)
  3001. var glob = undefined
  3002. try {
  3003. glob = __webpack_require__(12884)
  3004. } catch (_err) {
  3005. // treat glob as optional.
  3006. }
  3007. var _0666 = parseInt('666', 8)
  3008. var defaultGlobOpts = {
  3009. nosort: true,
  3010. silent: true
  3011. }
  3012. // for EMFILE handling
  3013. var timeout = 0
  3014. var isWindows = (process.platform === "win32")
  3015. function defaults (options) {
  3016. var methods = [
  3017. 'unlink',
  3018. 'chmod',
  3019. 'stat',
  3020. 'lstat',
  3021. 'rmdir',
  3022. 'readdir'
  3023. ]
  3024. methods.forEach(function(m) {
  3025. options[m] = options[m] || fs[m]
  3026. m = m + 'Sync'
  3027. options[m] = options[m] || fs[m]
  3028. })
  3029. options.maxBusyTries = options.maxBusyTries || 3
  3030. options.emfileWait = options.emfileWait || 1000
  3031. if (options.glob === false) {
  3032. options.disableGlob = true
  3033. }
  3034. if (options.disableGlob !== true && glob === undefined) {
  3035. throw Error('glob dependency not found, set `options.disableGlob = true` if intentional')
  3036. }
  3037. options.disableGlob = options.disableGlob || false
  3038. options.glob = options.glob || defaultGlobOpts
  3039. }
  3040. function rimraf (p, options, cb) {
  3041. if (typeof options === 'function') {
  3042. cb = options
  3043. options = {}
  3044. }
  3045. assert(p, 'rimraf: missing path')
  3046. assert.equal(typeof p, 'string', 'rimraf: path should be a string')
  3047. assert.equal(typeof cb, 'function', 'rimraf: callback function required')
  3048. assert(options, 'rimraf: invalid options argument provided')
  3049. assert.equal(typeof options, 'object', 'rimraf: options should be object')
  3050. defaults(options)
  3051. var busyTries = 0
  3052. var errState = null
  3053. var n = 0
  3054. if (options.disableGlob || !glob.hasMagic(p))
  3055. return afterGlob(null, [p])
  3056. options.lstat(p, function (er, stat) {
  3057. if (!er)
  3058. return afterGlob(null, [p])
  3059. glob(p, options.glob, afterGlob)
  3060. })
  3061. function next (er) {
  3062. errState = errState || er
  3063. if (--n === 0)
  3064. cb(errState)
  3065. }
  3066. function afterGlob (er, results) {
  3067. if (er)
  3068. return cb(er)
  3069. n = results.length
  3070. if (n === 0)
  3071. return cb()
  3072. results.forEach(function (p) {
  3073. rimraf_(p, options, function CB (er) {
  3074. if (er) {
  3075. if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") &&
  3076. busyTries < options.maxBusyTries) {
  3077. busyTries ++
  3078. var time = busyTries * 100
  3079. // try again, with the same exact callback as this one.
  3080. return setTimeout(function () {
  3081. rimraf_(p, options, CB)
  3082. }, time)
  3083. }
  3084. // this one won't happen if graceful-fs is used.
  3085. if (er.code === "EMFILE" && timeout < options.emfileWait) {
  3086. return setTimeout(function () {
  3087. rimraf_(p, options, CB)
  3088. }, timeout ++)
  3089. }
  3090. // already gone
  3091. if (er.code === "ENOENT") er = null
  3092. }
  3093. timeout = 0
  3094. next(er)
  3095. })
  3096. })
  3097. }
  3098. }
  3099. // Two possible strategies.
  3100. // 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR
  3101. // 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR
  3102. //
  3103. // Both result in an extra syscall when you guess wrong. However, there
  3104. // are likely far more normal files in the world than directories. This
  3105. // is based on the assumption that a the average number of files per
  3106. // directory is >= 1.
  3107. //
  3108. // If anyone ever complains about this, then I guess the strategy could
  3109. // be made configurable somehow. But until then, YAGNI.
  3110. function rimraf_ (p, options, cb) {
  3111. assert(p)
  3112. assert(options)
  3113. assert(typeof cb === 'function')
  3114. // sunos lets the root user unlink directories, which is... weird.
  3115. // so we have to lstat here and make sure it's not a dir.
  3116. options.lstat(p, function (er, st) {
  3117. if (er && er.code === "ENOENT")
  3118. return cb(null)
  3119. // Windows can EPERM on stat. Life is suffering.
  3120. if (er && er.code === "EPERM" && isWindows)
  3121. fixWinEPERM(p, options, er, cb)
  3122. if (st && st.isDirectory())
  3123. return rmdir(p, options, er, cb)
  3124. options.unlink(p, function (er) {
  3125. if (er) {
  3126. if (er.code === "ENOENT")
  3127. return cb(null)
  3128. if (er.code === "EPERM")
  3129. return (isWindows)
  3130. ? fixWinEPERM(p, options, er, cb)
  3131. : rmdir(p, options, er, cb)
  3132. if (er.code === "EISDIR")
  3133. return rmdir(p, options, er, cb)
  3134. }
  3135. return cb(er)
  3136. })
  3137. })
  3138. }
  3139. function fixWinEPERM (p, options, er, cb) {
  3140. assert(p)
  3141. assert(options)
  3142. assert(typeof cb === 'function')
  3143. if (er)
  3144. assert(er instanceof Error)
  3145. options.chmod(p, _0666, function (er2) {
  3146. if (er2)
  3147. cb(er2.code === "ENOENT" ? null : er)
  3148. else
  3149. options.stat(p, function(er3, stats) {
  3150. if (er3)
  3151. cb(er3.code === "ENOENT" ? null : er)
  3152. else if (stats.isDirectory())
  3153. rmdir(p, options, er, cb)
  3154. else
  3155. options.unlink(p, cb)
  3156. })
  3157. })
  3158. }
  3159. function fixWinEPERMSync (p, options, er) {
  3160. assert(p)
  3161. assert(options)
  3162. if (er)
  3163. assert(er instanceof Error)
  3164. try {
  3165. options.chmodSync(p, _0666)
  3166. } catch (er2) {
  3167. if (er2.code === "ENOENT")
  3168. return
  3169. else
  3170. throw er
  3171. }
  3172. try {
  3173. var stats = options.statSync(p)
  3174. } catch (er3) {
  3175. if (er3.code === "ENOENT")
  3176. return
  3177. else
  3178. throw er
  3179. }
  3180. if (stats.isDirectory())
  3181. rmdirSync(p, options, er)
  3182. else
  3183. options.unlinkSync(p)
  3184. }
  3185. function rmdir (p, options, originalEr, cb) {
  3186. assert(p)
  3187. assert(options)
  3188. if (originalEr)
  3189. assert(originalEr instanceof Error)
  3190. assert(typeof cb === 'function')
  3191. // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
  3192. // if we guessed wrong, and it's not a directory, then
  3193. // raise the original error.
  3194. options.rmdir(p, function (er) {
  3195. if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
  3196. rmkids(p, options, cb)
  3197. else if (er && er.code === "ENOTDIR")
  3198. cb(originalEr)
  3199. else
  3200. cb(er)
  3201. })
  3202. }
  3203. function rmkids(p, options, cb) {
  3204. assert(p)
  3205. assert(options)
  3206. assert(typeof cb === 'function')
  3207. options.readdir(p, function (er, files) {
  3208. if (er)
  3209. return cb(er)
  3210. var n = files.length
  3211. if (n === 0)
  3212. return options.rmdir(p, cb)
  3213. var errState
  3214. files.forEach(function (f) {
  3215. rimraf(path.join(p, f), options, function (er) {
  3216. if (errState)
  3217. return
  3218. if (er)
  3219. return cb(errState = er)
  3220. if (--n === 0)
  3221. options.rmdir(p, cb)
  3222. })
  3223. })
  3224. })
  3225. }
  3226. // this looks simpler, and is strictly *faster*, but will
  3227. // tie up the JavaScript thread and fail on excessively
  3228. // deep directory trees.
  3229. function rimrafSync (p, options) {
  3230. options = options || {}
  3231. defaults(options)
  3232. assert(p, 'rimraf: missing path')
  3233. assert.equal(typeof p, 'string', 'rimraf: path should be a string')
  3234. assert(options, 'rimraf: missing options')
  3235. assert.equal(typeof options, 'object', 'rimraf: options should be object')
  3236. var results
  3237. if (options.disableGlob || !glob.hasMagic(p)) {
  3238. results = [p]
  3239. } else {
  3240. try {
  3241. options.lstatSync(p)
  3242. results = [p]
  3243. } catch (er) {
  3244. results = glob.sync(p, options.glob)
  3245. }
  3246. }
  3247. if (!results.length)
  3248. return
  3249. for (var i = 0; i < results.length; i++) {
  3250. var p = results[i]
  3251. try {
  3252. var st = options.lstatSync(p)
  3253. } catch (er) {
  3254. if (er.code === "ENOENT")
  3255. return
  3256. // Windows can EPERM on stat. Life is suffering.
  3257. if (er.code === "EPERM" && isWindows)
  3258. fixWinEPERMSync(p, options, er)
  3259. }
  3260. try {
  3261. // sunos lets the root user unlink directories, which is... weird.
  3262. if (st && st.isDirectory())
  3263. rmdirSync(p, options, null)
  3264. else
  3265. options.unlinkSync(p)
  3266. } catch (er) {
  3267. if (er.code === "ENOENT")
  3268. return
  3269. if (er.code === "EPERM")
  3270. return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)
  3271. if (er.code !== "EISDIR")
  3272. throw er
  3273. rmdirSync(p, options, er)
  3274. }
  3275. }
  3276. }
  3277. function rmdirSync (p, options, originalEr) {
  3278. assert(p)
  3279. assert(options)
  3280. if (originalEr)
  3281. assert(originalEr instanceof Error)
  3282. try {
  3283. options.rmdirSync(p)
  3284. } catch (er) {
  3285. if (er.code === "ENOENT")
  3286. return
  3287. if (er.code === "ENOTDIR")
  3288. throw originalEr
  3289. if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
  3290. rmkidsSync(p, options)
  3291. }
  3292. }
  3293. function rmkidsSync (p, options) {
  3294. assert(p)
  3295. assert(options)
  3296. options.readdirSync(p).forEach(function (f) {
  3297. rimrafSync(path.join(p, f), options)
  3298. })
  3299. // We only end up here once we got ENOTEMPTY at least once, and
  3300. // at this point, we are guaranteed to have removed all the kids.
  3301. // So, we know that it won't be ENOENT or ENOTDIR or anything else.
  3302. // try really hard to delete stuff on windows, because it has a
  3303. // PROFOUNDLY annoying habit of not closing handles promptly when
  3304. // files are deleted, resulting in spurious ENOTEMPTY errors.
  3305. var retries = isWindows ? 100 : 1
  3306. var i = 0
  3307. do {
  3308. var threw = true
  3309. try {
  3310. var ret = options.rmdirSync(p, options)
  3311. threw = false
  3312. return ret
  3313. } finally {
  3314. if (++i < retries && threw)
  3315. continue
  3316. }
  3317. } while (true)
  3318. }
  3319. /***/ })
  3320. };
  3321. ;
  3322. //# sourceMappingURL=213.index.js.map