@modern-js/utils 2.32.2-alpha.1 → 2.33.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,21 +0,0 @@
1
- // Type definitions for recursive-readdir 2.2
2
- // Project: https://github.com/jergason/recursive-readdir/
3
- // Definitions by: Elisée Maurer <https://github.com/elisee>, Micah Zoltu <https://github.com/MicahZoltu>
4
- // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
-
6
- /// <reference types="node" />
7
-
8
- import * as fs from 'fs';
9
- declare namespace RecursiveReaddir {
10
- type IgnoreFunction = (file: string, stats: fs.Stats) => boolean;
11
- type Ignores = ReadonlyArray<string|IgnoreFunction>;
12
- type Callback = (error: Error, files: string[]) => void;
13
- interface readDir {
14
- (path: string, ignores?: Ignores): Promise<string[]>;
15
- (path: string, callback: Callback): void;
16
- (path: string, ignores: Ignores, callback: Callback): void;
17
- }
18
- }
19
-
20
- declare var recursiveReadDir: RecursiveReaddir.readDir;
21
- export = recursiveReadDir;
@@ -1 +0,0 @@
1
- (()=>{var e={155:e=>{"use strict";e.exports=balanced;function balanced(e,t,r){if(e instanceof RegExp)e=maybeMatch(e,r);if(t instanceof RegExp)t=maybeMatch(t,r);var n=range(e,t,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+e.length,n[1]),post:r.slice(n[1]+t.length)}}function maybeMatch(e,t){var r=t.match(e);return r?r[0]:null}balanced.range=range;function range(e,t,r){var n,a,i,s,c;var o=r.indexOf(e);var u=r.indexOf(t,o+1);var f=o;if(o>=0&&u>0){if(e===t){return[o,u]}n=[];i=r.length;while(f>=0&&!c){if(f==o){n.push(f);o=r.indexOf(e,f+1)}else if(n.length==1){c=[n.pop(),u]}else{a=n.pop();if(a<i){i=a;s=u}u=r.indexOf(t,f+1)}f=o<u&&o>=0?o:u}if(n.length){c=[i,s]}}return c}},847:(e,t,r)=>{var n=r(62);var a=r(155);e.exports=expandTop;var i="\0SLASH"+Math.random()+"\0";var s="\0OPEN"+Math.random()+"\0";var c="\0CLOSE"+Math.random()+"\0";var o="\0COMMA"+Math.random()+"\0";var u="\0PERIOD"+Math.random()+"\0";function numeric(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function escapeBraces(e){return e.split("\\\\").join(i).split("\\{").join(s).split("\\}").join(c).split("\\,").join(o).split("\\.").join(u)}function unescapeBraces(e){return e.split(i).join("\\").split(s).join("{").split(c).join("}").split(o).join(",").split(u).join(".")}function parseCommaParts(e){if(!e)return[""];var t=[];var r=a("{","}",e);if(!r)return e.split(",");var n=r.pre;var i=r.body;var s=r.post;var c=n.split(",");c[c.length-1]+="{"+i+"}";var o=parseCommaParts(s);if(s.length){c[c.length-1]+=o.shift();c.push.apply(c,o)}t.push.apply(t,c);return t}function expandTop(e){if(!e)return[];if(e.substr(0,2)==="{}"){e="\\{\\}"+e.substr(2)}return expand(escapeBraces(e),true).map(unescapeBraces)}function identity(e){return e}function embrace(e){return"{"+e+"}"}function isPadded(e){return/^-?0\d/.test(e)}function lte(e,t){return e<=t}function gte(e,t){return e>=t}function expand(e,t){var r=[];var i=a("{","}",e);if(!i||/\$$/.test(i.pre))return[e];var s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body);var o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body);var u=s||o;var f=i.body.indexOf(",")>=0;if(!u&&!f){if(i.post.match(/,.*\}/)){e=i.pre+"{"+i.body+c+i.post;return expand(e)}return[e]}var h;if(u){h=i.body.split(/\.\./)}else{h=parseCommaParts(i.body);if(h.length===1){h=expand(h[0],false).map(embrace);if(h.length===1){var p=i.post.length?expand(i.post,false):[""];return p.map((function(e){return i.pre+h[0]+e}))}}}var l=i.pre;var p=i.post.length?expand(i.post,false):[""];var m;if(u){var g=numeric(h[0]);var v=numeric(h[1]);var d=Math.max(h[0].length,h[1].length);var b=h.length==3?Math.abs(numeric(h[2])):1;var y=lte;var x=v<g;if(x){b*=-1;y=gte}var M=h.some(isPadded);m=[];for(var w=g;y(w,v);w+=b){var E;if(o){E=String.fromCharCode(w);if(E==="\\")E=""}else{E=String(w);if(M){var _=d-E.length;if(_>0){var j=new Array(_+1).join("0");if(w<0)E="-"+j+E.slice(1);else E=j+E}}}m.push(E)}}else{m=n(h,(function(e){return expand(e,false)}))}for(var S=0;S<m.length;S++){for(var O=0;O<p.length;O++){var k=l+m[S]+p[O];if(!t||u||k)r.push(k)}}return r}},62:e=>{e.exports=function(e,r){var n=[];for(var a=0;a<e.length;a++){var i=r(e[a],a);if(t(i))n.push.apply(n,i);else n.push(i)}return n};var t=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},435:(e,t,r)=>{e.exports=minimatch;minimatch.Minimatch=Minimatch;var n={sep:"/"};try{n=r(17)}catch(e){}var a=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var i=r(847);var s={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var c="[^/]";var o=c+"*?";var u="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var f="(?:(?!(?:\\/|^)\\.).)*?";var h=charSet("().*{}+?[]^$\\!");function charSet(e){return e.split("").reduce((function(e,t){e[t]=true;return e}),{})}var p=/\/+/;minimatch.filter=filter;function filter(e,t){t=t||{};return function(r,n,a){return minimatch(r,e,t)}}function ext(e,t){e=e||{};t=t||{};var r={};Object.keys(t).forEach((function(e){r[e]=t[e]}));Object.keys(e).forEach((function(t){r[t]=e[t]}));return r}minimatch.defaults=function(e){if(!e||!Object.keys(e).length)return minimatch;var t=minimatch;var r=function minimatch(r,n,a){return t.minimatch(r,n,ext(e,a))};r.Minimatch=function Minimatch(r,n){return new t.Minimatch(r,ext(e,n))};return r};Minimatch.defaults=function(e){if(!e||!Object.keys(e).length)return Minimatch;return minimatch.defaults(e).Minimatch};function minimatch(e,t,r){if(typeof t!=="string"){throw new TypeError("glob pattern string required")}if(!r)r={};if(!r.nocomment&&t.charAt(0)==="#"){return false}if(t.trim()==="")return e==="";return new Minimatch(t,r).match(e)}function Minimatch(e,t){if(!(this instanceof Minimatch)){return new Minimatch(e,t)}if(typeof e!=="string"){throw new TypeError("glob pattern string required")}if(!t)t={};e=e.trim();if(n.sep!=="/"){e=e.split(n.sep).join("/")}this.options=t;this.set=[];this.pattern=e;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){if(this._made)return;var e=this.pattern;var t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=true;return}if(!e){this.empty=true;return}this.parseNegate();var r=this.globSet=this.braceExpand();if(t.debug)this.debug=console.error;this.debug(this.pattern,r);r=this.globParts=r.map((function(e){return e.split(p)}));this.debug(this.pattern,r);r=r.map((function(e,t,r){return e.map(this.parse,this)}),this);this.debug(this.pattern,r);r=r.filter((function(e){return e.indexOf(false)===-1}));this.debug(this.pattern,r);this.set=r}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var e=this.pattern;var t=false;var r=this.options;var n=0;if(r.nonegate)return;for(var a=0,i=e.length;a<i&&e.charAt(a)==="!";a++){t=!t;n++}if(n)this.pattern=e.substr(n);this.negate=t}minimatch.braceExpand=function(e,t){return braceExpand(e,t)};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(e,t){if(!t){if(this instanceof Minimatch){t=this.options}else{t={}}}e=typeof e==="undefined"?this.pattern:e;if(typeof e==="undefined"){throw new TypeError("undefined pattern")}if(t.nobrace||!e.match(/\{.*\}/)){return[e]}return i(e)}Minimatch.prototype.parse=parse;var l={};function parse(e,t){if(e.length>1024*64){throw new TypeError("pattern is too long")}var r=this.options;if(!r.noglobstar&&e==="**")return a;if(e==="")return"";var n="";var i=!!r.nocase;var u=false;var f=[];var p=[];var m;var g=false;var v=-1;var d=-1;var b=e.charAt(0)==="."?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";var y=this;function clearStateChar(){if(m){switch(m){case"*":n+=o;i=true;break;case"?":n+=c;i=true;break;default:n+="\\"+m;break}y.debug("clearStateChar %j %j",m,n);m=false}}for(var x=0,M=e.length,w;x<M&&(w=e.charAt(x));x++){this.debug("%s\t%s %s %j",e,x,n,w);if(u&&h[w]){n+="\\"+w;u=false;continue}switch(w){case"/":return false;case"\\":clearStateChar();u=true;continue;case"?":case"*":case"+":case"@":case"!":this.debug("%s\t%s %s %j <-- stateChar",e,x,n,w);if(g){this.debug(" in class");if(w==="!"&&x===d+1)w="^";n+=w;continue}y.debug("call clearStateChar %j",m);clearStateChar();m=w;if(r.noext)clearStateChar();continue;case"(":if(g){n+="(";continue}if(!m){n+="\\(";continue}f.push({type:m,start:x-1,reStart:n.length,open:s[m].open,close:s[m].close});n+=m==="!"?"(?:(?!(?:":"(?:";this.debug("plType %j %j",m,n);m=false;continue;case")":if(g||!f.length){n+="\\)";continue}clearStateChar();i=true;var E=f.pop();n+=E.close;if(E.type==="!"){p.push(E)}E.reEnd=n.length;continue;case"|":if(g||!f.length||u){n+="\\|";u=false;continue}clearStateChar();n+="|";continue;case"[":clearStateChar();if(g){n+="\\"+w;continue}g=true;d=x;v=n.length;n+=w;continue;case"]":if(x===d+1||!g){n+="\\"+w;u=false;continue}if(g){var _=e.substring(d+1,x);try{RegExp("["+_+"]")}catch(e){var j=this.parse(_,l);n=n.substr(0,v)+"\\["+j[0]+"\\]";i=i||j[1];g=false;continue}}i=true;g=false;n+=w;continue;default:clearStateChar();if(u){u=false}else if(h[w]&&!(w==="^"&&g)){n+="\\"}n+=w}}if(g){_=e.substr(d+1);j=this.parse(_,l);n=n.substr(0,v)+"\\["+j[0];i=i||j[1]}for(E=f.pop();E;E=f.pop()){var S=n.slice(E.reStart+E.open.length);this.debug("setting tail",n,E);S=S.replace(/((?:\\{2}){0,64})(\\?)\|/g,(function(e,t,r){if(!r){r="\\"}return t+t+r+"|"}));this.debug("tail=%j\n %s",S,S,E,n);var O=E.type==="*"?o:E.type==="?"?c:"\\"+E.type;i=true;n=n.slice(0,E.reStart)+O+"\\("+S}clearStateChar();if(u){n+="\\\\"}var k=false;switch(n.charAt(0)){case".":case"[":case"(":k=true}for(var C=p.length-1;C>-1;C--){var A=p[C];var R=n.slice(0,A.reStart);var $=n.slice(A.reStart,A.reEnd-8);var T=n.slice(A.reEnd-8,A.reEnd);var q=n.slice(A.reEnd);T+=q;var B=R.split("(").length-1;var P=q;for(x=0;x<B;x++){P=P.replace(/\)[+*?]?/,"")}q=P;var L="";if(q===""&&t!==l){L="$"}var N=R+$+q+L+T;n=N}if(n!==""&&i){n="(?=.)"+n}if(k){n=b+n}if(t===l){return[n,i]}if(!i){return globUnescape(e)}var F=r.nocase?"i":"";try{var G=new RegExp("^"+n+"$",F)}catch(e){return new RegExp("$.")}G._glob=e;G._src=n;return G}minimatch.makeRe=function(e,t){return new Minimatch(e,t||{}).makeRe()};Minimatch.prototype.makeRe=makeRe;function makeRe(){if(this.regexp||this.regexp===false)return this.regexp;var e=this.set;if(!e.length){this.regexp=false;return this.regexp}var t=this.options;var r=t.noglobstar?o:t.dot?u:f;var n=t.nocase?"i":"";var i=e.map((function(e){return e.map((function(e){return e===a?r:typeof e==="string"?regExpEscape(e):e._src})).join("\\/")})).join("|");i="^(?:"+i+")$";if(this.negate)i="^(?!"+i+").*$";try{this.regexp=new RegExp(i,n)}catch(e){this.regexp=false}return this.regexp}minimatch.match=function(e,t,r){r=r||{};var n=new Minimatch(t,r);e=e.filter((function(e){return n.match(e)}));if(n.options.nonull&&!e.length){e.push(t)}return e};Minimatch.prototype.match=match;function match(e,t){this.debug("match",e,this.pattern);if(this.comment)return false;if(this.empty)return e==="";if(e==="/"&&t)return true;var r=this.options;if(n.sep!=="/"){e=e.split(n.sep).join("/")}e=e.split(p);this.debug(this.pattern,"split",e);var a=this.set;this.debug(this.pattern,"set",a);var i;var s;for(s=e.length-1;s>=0;s--){i=e[s];if(i)break}for(s=0;s<a.length;s++){var c=a[s];var o=e;if(r.matchBase&&c.length===1){o=[i]}var u=this.matchOne(o,c,t);if(u){if(r.flipNegate)return true;return!this.negate}}if(r.flipNegate)return false;return this.negate}Minimatch.prototype.matchOne=function(e,t,r){var n=this.options;this.debug("matchOne",{this:this,file:e,pattern:t});this.debug("matchOne",e.length,t.length);for(var i=0,s=0,c=e.length,o=t.length;i<c&&s<o;i++,s++){this.debug("matchOne loop");var u=t[s];var f=e[i];this.debug(t,u,f);if(u===false)return false;if(u===a){this.debug("GLOBSTAR",[t,u,f]);var h=i;var p=s+1;if(p===o){this.debug("** at the end");for(;i<c;i++){if(e[i]==="."||e[i]===".."||!n.dot&&e[i].charAt(0)===".")return false}return true}while(h<c){var l=e[h];this.debug("\nglobstar while",e,h,t,p,l);if(this.matchOne(e.slice(h),t.slice(p),r)){this.debug("globstar found match!",h,c,l);return true}else{if(l==="."||l===".."||!n.dot&&l.charAt(0)==="."){this.debug("dot detected!",e,h,t,p);break}this.debug("globstar swallow a segment, and continue");h++}}if(r){this.debug("\n>>> no match, partial?",e,h,t,p);if(h===c)return true}return false}var m;if(typeof u==="string"){if(n.nocase){m=f.toLowerCase()===u.toLowerCase()}else{m=f===u}this.debug("string match",u,f,m)}else{m=f.match(u);this.debug("pattern match",u,f,m)}if(!m)return false}if(i===c&&s===o){return true}else if(i===c){return r}else if(s===o){var g=i===c-1&&e[i]==="";return g}throw new Error("wtf?")};function globUnescape(e){return e.replace(/\\(.)/g,"$1")}function regExpEscape(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},736:(e,t,r)=>{var n=r(147);var a=r(17);var i=r(435);function patternMatcher(e){return function(t,r){var n=new i.Minimatch(e,{matchBase:true});return(!n.negate||r.isFile())&&n.match(t)}}function toMatcherFunction(e){if(typeof e=="function"){return e}else{return patternMatcher(e)}}function readdir(e,t,r){if(typeof t=="function"){r=t;t=[]}if(!r){return new Promise((function(r,n){readdir(e,t||[],(function(e,t){if(e){n(e)}else{r(t)}}))}))}t=t.map(toMatcherFunction);var i=[];n.readdir(e,(function(s,c){if(s){return r(s)}var o=c.length;if(!o){return r(null,i)}c.forEach((function(s){var c=a.join(e,s);n.stat(c,(function(e,n){if(e){return r(e)}if(t.some((function(e){return e(c,n)}))){o-=1;if(!o){return r(null,i)}return null}if(n.isDirectory()){readdir(c,t,(function(e,t){if(e){return r(e)}i=i.concat(t);o-=1;if(!o){return r(null,i)}}))}else{i.push(c);o-=1;if(!o){return r(null,i)}}}))}))}))}e.exports=readdir},147:e=>{"use strict";e.exports=require("fs")},17:e=>{"use strict";e.exports=require("path")}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var a=t[r]={exports:{}};var i=true;try{e[r](a,a.exports,__nccwpck_require__);i=false}finally{if(i)delete t[r]}return a.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(736);module.exports=r})();
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) <year> <copyright holders>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1 +0,0 @@
1
- {"name":"recursive-readdir","author":"Jamison Dance <jergason@gmail.com> (http://jamisondance.com/)","version":"2.2.2","license":"MIT"}