made with requirebin
Created
November 28, 2017 14:15
-
-
Save sebakerckhof/5dcc641ad88aad6ff70de75a1bfaa253 to your computer and use it in GitHub Desktop.
requirebin sketch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Welcome! require() some modules from npm (like you were using browserify) | |
// and then hit Run Code to run your code on the right side. | |
// Modules get downloaded from browserify-cdn and bundled in your browser. | |
const glob = require('glob'); | |
var minimatch = require("minimatch") | |
console.log(glob.hasMagic('/home/seba/dev/home/home-app/.meteor/local/!(db)')); | |
//console.log(minimatch("/test/foo/d",'/test/foo/!(db)')) // true! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setTimeout(function(){require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")};exports.sep="/";exports.delimiter=":";exports.dirname=function(path){var result=splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir};exports.basename=function(path,ext){var f=splitPath(path)[2];if(ext&&f.substr(-1*ext.length)===ext){f=f.substr(0,f.length-ext.length)}return f};exports.extname=function(path){return splitPath(path)[3]};function filter(xs,f){if(xs.filter)return xs.filter(f);var res=[];for(var i=0;i<xs.length;i++){if(f(xs[i],i,xs))res.push(xs[i])}return res}var substr="ab".substr(-1)==="b"?function(str,start,len){return str.substr(start,len)}:function(str,start,len){if(start<0)start=str.length+start;return str.substr(start,len)}}).call(this,require("_process"))},{_process:2}],2:[function(require,module,exports){var process=module.exports={};var cachedSetTimeout;var cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){cachedSetTimeout=setTimeout}else{cachedSetTimeout=defaultSetTimout}}catch(e){cachedSetTimeout=defaultSetTimout}try{if(typeof clearTimeout==="function"){cachedClearTimeout=clearTimeout}else{cachedClearTimeout=defaultClearTimeout}}catch(e){cachedClearTimeout=defaultClearTimeout}})();function runTimeout(fun){if(cachedSetTimeout===setTimeout){return setTimeout(fun,0)}if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout){cachedSetTimeout=setTimeout;return setTimeout(fun,0)}try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout){return clearTimeout(marker)}if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout){cachedClearTimeout=clearTimeout;return clearTimeout(marker)}try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}var queue=[];var draining=false;var currentQueue;var queueIndex=-1;function cleanUpNextTick(){if(!draining||!currentQueue){return}draining=false;if(currentQueue.length){queue=currentQueue.concat(queue)}else{queueIndex=-1}if(queue.length){drainQueue()}}function drainQueue(){if(draining){return}var timeout=runTimeout(cleanUpNextTick);draining=true;var len=queue.length;while(len){currentQueue=queue;queue=[];while(++queueIndex<len){if(currentQueue){currentQueue[queueIndex].run()}}queueIndex=-1;len=queue.length}currentQueue=null;draining=false;runClearTimeout(timeout)}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1){for(var i=1;i<arguments.length;i++){args[i-1]=arguments[i]}}queue.push(new Item(fun,args));if(queue.length===1&&!draining){runTimeout(drainQueue)}};function Item(fun,array){this.fun=fun;this.array=array}Item.prototype.run=function(){this.fun.apply(null,this.array)};process.title="browser";process.browser=true;process.env={};process.argv=[];process.version="";process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")};process.umask=function(){return 0}},{}],3:[function(require,module,exports){var concatMap=require("concat-map");var balanced=require("balanced-match");module.exports=expandTop;var escSlash="\x00SLASH"+Math.random()+"\x00";var escOpen="\x00OPEN"+Math.random()+"\x00";var escClose="\x00CLOSE"+Math.random()+"\x00";var escComma="\x00COMMA"+Math.random()+"\x00";var escPeriod="\x00PERIOD"+Math.random()+"\x00";function numeric(str){return parseInt(str,10)==str?parseInt(str,10):str.charCodeAt(0)}function escapeBraces(str){return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod)}function unescapeBraces(str){return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".")}function parseCommaParts(str){if(!str)return[""];var parts=[];var m=balanced("{","}",str);if(!m)return str.split(",");var pre=m.pre;var body=m.body;var post=m.post;var p=pre.split(",");p[p.length-1]+="{"+body+"}";var postParts=parseCommaParts(post);if(post.length){p[p.length-1]+=postParts.shift();p.push.apply(p,postParts)}parts.push.apply(parts,p);return parts}function expandTop(str){if(!str)return[];if(str.substr(0,2)==="{}"){str="\\{\\}"+str.substr(2)}return expand(escapeBraces(str),true).map(unescapeBraces)}function identity(e){return e}function embrace(str){return"{"+str+"}"}function isPadded(el){return/^-?0\d/.test(el)}function lte(i,y){return i<=y}function gte(i,y){return i>=y}function expand(str,isTop){var expansions=[];var m=balanced("{","}",str);if(!m||/\$$/.test(m.pre))return[str];var isNumericSequence=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);var isAlphaSequence=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);var isSequence=isNumericSequence||isAlphaSequence;var isOptions=/^(.*,)+(.+)?$/.test(m.body);if(!isSequence&&!isOptions){if(m.post.match(/,.*\}/)){str=m.pre+"{"+m.body+escClose+m.post;return expand(str)}return[str]}var n;if(isSequence){n=m.body.split(/\.\./)}else{n=parseCommaParts(m.body);if(n.length===1){n=expand(n[0],false).map(embrace);if(n.length===1){var post=m.post.length?expand(m.post,false):[""];return post.map(function(p){return m.pre+n[0]+p})}}}var pre=m.pre;var post=m.post.length?expand(m.post,false):[""];var N;if(isSequence){var x=numeric(n[0]);var y=numeric(n[1]);var width=Math.max(n[0].length,n[1].length);var incr=n.length==3?Math.abs(numeric(n[2])):1;var test=lte;var reverse=y<x;if(reverse){incr*=-1;test=gte}var pad=n.some(isPadded);N=[];for(var i=x;test(i,y);i+=incr){var c;if(isAlphaSequence){c=String.fromCharCode(i);if(c==="\\")c=""}else{c=String(i);if(pad){var need=width-c.length;if(need>0){var z=new Array(need+1).join("0");if(i<0)c="-"+z+c.slice(1);else c=z+c}}}N.push(c)}}else{N=concatMap(n,function(el){return expand(el,false)})}for(var j=0;j<N.length;j++){for(var k=0;k<post.length;k++){var expansion=pre+N[j]+post[k];if(!isTop||isSequence||expansion)expansions.push(expansion)}}return expansions}},{"balanced-match":4,"concat-map":5}],4:[function(require,module,exports){module.exports=balanced;function balanced(a,b,str){if(a instanceof RegExp)a=maybeMatch(a,str);if(b instanceof RegExp)b=maybeMatch(b,str);var r=range(a,b,str);return r&&{start:r[0],end:r[1],pre:str.slice(0,r[0]),body:str.slice(r[0]+a.length,r[1]),post:str.slice(r[1]+b.length)}}function maybeMatch(reg,str){var m=str.match(reg);return m?m[0]:null}balanced.range=range;function range(a,b,str){var begs,beg,left,right,result;var ai=str.indexOf(a);var bi=str.indexOf(b,ai+1);var i=ai;if(ai>=0&&bi>0){begs=[];left=str.length;while(i>=0&&!result){if(i==ai){begs.push(i);ai=str.indexOf(a,i+1)}else if(begs.length==1){result=[begs.pop(),bi]}else{beg=begs.pop();if(beg<left){left=beg;right=bi}bi=str.indexOf(b,i+1)}i=ai<bi&&ai>=0?ai:bi}if(begs.length){result=[left,right]}}return result}},{}],5:[function(require,module,exports){module.exports=function(xs,fn){var res=[];for(var i=0;i<xs.length;i++){var x=fn(xs[i],i);if(isArray(x))res.push.apply(res,x);else res.push(x)}return res};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==="[object Array]"}},{}],minimatch:[function(require,module,exports){module.exports=minimatch;minimatch.Minimatch=Minimatch;var path={sep:"/"};try{path=require("path")}catch(er){}var GLOBSTAR=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var expand=require("brace-expansion");var plTypes={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var qmark="[^/]";var star=qmark+"*?";var twoStarDot="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var twoStarNoDot="(?:(?!(?:\\/|^)\\.).)*?";var reSpecials=charSet("().*{}+?[]^$\\!");function charSet(s){return s.split("").reduce(function(set,c){set[c]=true;return set},{})}var slashSplit=/\/+/;minimatch.filter=filter;function filter(pattern,options){options=options||{};return function(p,i,list){return minimatch(p,pattern,options)}}function ext(a,b){a=a||{};b=b||{};var t={};Object.keys(b).forEach(function(k){t[k]=b[k]});Object.keys(a).forEach(function(k){t[k]=a[k]});return t}minimatch.defaults=function(def){if(!def||!Object.keys(def).length)return minimatch;var orig=minimatch;var m=function minimatch(p,pattern,options){return orig.minimatch(p,pattern,ext(def,options))};m.Minimatch=function Minimatch(pattern,options){return new orig.Minimatch(pattern,ext(def,options))};return m};Minimatch.defaults=function(def){if(!def||!Object.keys(def).length)return Minimatch;return minimatch.defaults(def).Minimatch};function minimatch(p,pattern,options){if(typeof pattern!=="string"){throw new TypeError("glob pattern string required")}if(!options)options={};if(!options.nocomment&&pattern.charAt(0)==="#"){return false}if(pattern.trim()==="")return p==="";return new Minimatch(pattern,options).match(p)}function Minimatch(pattern,options){if(!(this instanceof Minimatch)){return new Minimatch(pattern,options)}if(typeof pattern!=="string"){throw new TypeError("glob pattern string required")}if(!options)options={};pattern=pattern.trim();if(path.sep!=="/"){pattern=pattern.split(path.sep).join("/")}this.options=options;this.set=[];this.pattern=pattern;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 pattern=this.pattern;var options=this.options;if(!options.nocomment&&pattern.charAt(0)==="#"){this.comment=true;return}if(!pattern){this.empty=true;return}this.parseNegate();var set=this.globSet=this.braceExpand();if(options.debug)this.debug=console.error;this.debug(this.pattern,set);set=this.globParts=set.map(function(s){return s.split(slashSplit)});this.debug(this.pattern,set);set=set.map(function(s,si,set){return s.map(this.parse,this)},this);this.debug(this.pattern,set);set=set.filter(function(s){return s.indexOf(false)===-1});this.debug(this.pattern,set);this.set=set}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var pattern=this.pattern;var negate=false;var options=this.options;var negateOffset=0;if(options.nonegate)return;for(var i=0,l=pattern.length;i<l&&pattern.charAt(i)==="!";i++){negate=!negate;negateOffset++}if(negateOffset)this.pattern=pattern.substr(negateOffset);this.negate=negate}minimatch.braceExpand=function(pattern,options){return braceExpand(pattern,options)};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(pattern,options){if(!options){if(this instanceof Minimatch){options=this.options}else{options={}}}pattern=typeof pattern==="undefined"?this.pattern:pattern;if(typeof pattern==="undefined"){throw new TypeError("undefined pattern")}if(options.nobrace||!pattern.match(/\{.*\}/)){return[pattern]}return expand(pattern)}Minimatch.prototype.parse=parse;var SUBPARSE={};function parse(pattern,isSub){if(pattern.length>1024*64){throw new TypeError("pattern is too long")}var options=this.options;if(!options.noglobstar&&pattern==="**")return GLOBSTAR;if(pattern==="")return"";var re="";var hasMagic=!!options.nocase;var escaping=false;var patternListStack=[];var negativeLists=[];var stateChar;var inClass=false;var reClassStart=-1;var classStart=-1;var patternStart=pattern.charAt(0)==="."?"":options.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";var self=this;function clearStateChar(){if(stateChar){switch(stateChar){case"*":re+=star;hasMagic=true;break;case"?":re+=qmark;hasMagic=true;break;default:re+="\\"+stateChar;break}self.debug("clearStateChar %j %j",stateChar,re);stateChar=false}}for(var i=0,len=pattern.length,c;i<len&&(c=pattern.charAt(i));i++){this.debug("%s %s %s %j",pattern,i,re,c);if(escaping&&reSpecials[c]){re+="\\"+c;escaping=false;continue}switch(c){case"/":return false;case"\\":clearStateChar();escaping=true;continue;case"?":case"*":case"+":case"@":case"!":this.debug("%s %s %s %j <-- stateChar",pattern,i,re,c);if(inClass){this.debug(" in class");if(c==="!"&&i===classStart+1)c="^";re+=c;continue}self.debug("call clearStateChar %j",stateChar);clearStateChar();stateChar=c;if(options.noext)clearStateChar();continue;case"(":if(inClass){re+="(";continue}if(!stateChar){re+="\\(";continue}patternListStack.push({type:stateChar,start:i-1,reStart:re.length,open:plTypes[stateChar].open,close:plTypes[stateChar].close});re+=stateChar==="!"?"(?:(?!(?:":"(?:";this.debug("plType %j %j",stateChar,re);stateChar=false;continue;case")":if(inClass||!patternListStack.length){re+="\\)";continue}clearStateChar();hasMagic=true;var pl=patternListStack.pop();re+=pl.close;if(pl.type==="!"){negativeLists.push(pl)}pl.reEnd=re.length;continue;case"|":if(inClass||!patternListStack.length||escaping){re+="\\|";escaping=false;continue}clearStateChar();re+="|";continue;case"[":clearStateChar();if(inClass){re+="\\"+c;continue}inClass=true;classStart=i;reClassStart=re.length;re+=c;continue;case"]":if(i===classStart+1||!inClass){re+="\\"+c;escaping=false;continue}if(inClass){var cs=pattern.substring(classStart+1,i);try{RegExp("["+cs+"]")}catch(er){var sp=this.parse(cs,SUBPARSE);re=re.substr(0,reClassStart)+"\\["+sp[0]+"\\]";hasMagic=hasMagic||sp[1];inClass=false;continue}}hasMagic=true;inClass=false;re+=c;continue;default:clearStateChar();if(escaping){escaping=false}else if(reSpecials[c]&&!(c==="^"&&inClass)){re+="\\"}re+=c}}if(inClass){cs=pattern.substr(classStart+1);sp=this.parse(cs,SUBPARSE);re=re.substr(0,reClassStart)+"\\["+sp[0];hasMagic=hasMagic||sp[1]}for(pl=patternListStack.pop();pl;pl=patternListStack.pop()){var tail=re.slice(pl.reStart+pl.open.length);this.debug("setting tail",re,pl);tail=tail.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(_,$1,$2){if(!$2){$2="\\"}return $1+$1+$2+"|"});this.debug("tail=%j\n %s",tail,tail,pl,re);var t=pl.type==="*"?star:pl.type==="?"?qmark:"\\"+pl.type;hasMagic=true;re=re.slice(0,pl.reStart)+t+"\\("+tail}clearStateChar();if(escaping){re+="\\\\"}var addPatternStart=false;switch(re.charAt(0)){case".":case"[":case"(":addPatternStart=true}for(var n=negativeLists.length-1;n>-1;n--){var nl=negativeLists[n];var nlBefore=re.slice(0,nl.reStart);var nlFirst=re.slice(nl.reStart,nl.reEnd-8);var nlLast=re.slice(nl.reEnd-8,nl.reEnd);var nlAfter=re.slice(nl.reEnd);nlLast+=nlAfter;var openParensBefore=nlBefore.split("(").length-1;var cleanAfter=nlAfter;for(i=0;i<openParensBefore;i++){cleanAfter=cleanAfter.replace(/\)[+*?]?/,"")}nlAfter=cleanAfter;var dollar="";if(nlAfter===""&&isSub!==SUBPARSE){dollar="$"}var newRe=nlBefore+nlFirst+nlAfter+dollar+nlLast;re=newRe}if(re!==""&&hasMagic){re="(?=.)"+re}if(addPatternStart){re=patternStart+re}if(isSub===SUBPARSE){return[re,hasMagic]}if(!hasMagic){return globUnescape(pattern)}var flags=options.nocase?"i":"";try{var regExp=new RegExp("^"+re+"$",flags)}catch(er){return new RegExp("$.")}regExp._glob=pattern;regExp._src=re;return regExp}minimatch.makeRe=function(pattern,options){return new Minimatch(pattern,options||{}).makeRe()};Minimatch.prototype.makeRe=makeRe;function makeRe(){if(this.regexp||this.regexp===false)return this.regexp;var set=this.set;if(!set.length){this.regexp=false;return this.regexp}var options=this.options;var twoStar=options.noglobstar?star:options.dot?twoStarDot:twoStarNoDot;var flags=options.nocase?"i":"";var re=set.map(function(pattern){return pattern.map(function(p){return p===GLOBSTAR?twoStar:typeof p==="string"?regExpEscape(p):p._src}).join("\\/")}).join("|");re="^(?:"+re+")$";if(this.negate)re="^(?!"+re+").*$";try{this.regexp=new RegExp(re,flags)}catch(ex){this.regexp=false}return this.regexp}minimatch.match=function(list,pattern,options){options=options||{};var mm=new Minimatch(pattern,options);list=list.filter(function(f){return mm.match(f)});if(mm.options.nonull&&!list.length){list.push(pattern)}return list};Minimatch.prototype.match=match;function match(f,partial){this.debug("match",f,this.pattern);if(this.comment)return false;if(this.empty)return f==="";if(f==="/"&&partial)return true;var options=this.options;if(path.sep!=="/"){f=f.split(path.sep).join("/")}f=f.split(slashSplit);this.debug(this.pattern,"split",f);var set=this.set;this.debug(this.pattern,"set",set);var filename;var i;for(i=f.length-1;i>=0;i--){filename=f[i];if(filename)break}for(i=0;i<set.length;i++){var pattern=set[i];var file=f;if(options.matchBase&&pattern.length===1){file=[filename]}var hit=this.matchOne(file,pattern,partial);if(hit){if(options.flipNegate)return true;return!this.negate}}if(options.flipNegate)return false;return this.negate}Minimatch.prototype.matchOne=function(file,pattern,partial){var options=this.options;this.debug("matchOne",{"this":this,file:file,pattern:pattern});this.debug("matchOne",file.length,pattern.length);for(var fi=0,pi=0,fl=file.length,pl=pattern.length;fi<fl&&pi<pl;fi++,pi++){this.debug("matchOne loop");var p=pattern[pi];var f=file[fi];this.debug(pattern,p,f);if(p===false)return false;if(p===GLOBSTAR){this.debug("GLOBSTAR",[pattern,p,f]);var fr=fi;var pr=pi+1;if(pr===pl){this.debug("** at the end");for(;fi<fl;fi++){if(file[fi]==="."||file[fi]===".."||!options.dot&&file[fi].charAt(0)===".")return false}return true}while(fr<fl){var swallowee=file[fr];this.debug("\nglobstar while",file,fr,pattern,pr,swallowee);if(this.matchOne(file.slice(fr),pattern.slice(pr),partial)){this.debug("globstar found match!",fr,fl,swallowee);return true}else{if(swallowee==="."||swallowee===".."||!options.dot&&swallowee.charAt(0)==="."){this.debug("dot detected!",file,fr,pattern,pr);break}this.debug("globstar swallow a segment, and continue");fr++}}if(partial){this.debug("\n>>> no match, partial?",file,fr,pattern,pr);if(fr===fl)return true}return false}var hit;if(typeof p==="string"){if(options.nocase){hit=f.toLowerCase()===p.toLowerCase()}else{hit=f===p}this.debug("string match",p,f,hit)}else{hit=f.match(p);this.debug("pattern match",p,f,hit)}if(!hit)return false}if(fi===fl&&pi===pl){return true}else if(fi===fl){return partial}else if(pi===pl){var emptyFileEnd=fi===fl-1&&file[fi]==="";return emptyFileEnd}throw new Error("wtf?")};function globUnescape(s){return s.replace(/\\(.)/g,"$1")}function regExpEscape(s){return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},{"brace-expansion":3,path:1}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){},{}],2:[function(require,module,exports){var util=require("util/");var pSlice=Array.prototype.slice;var hasOwn=Object.prototype.hasOwnProperty;var assert=module.exports=ok;assert.AssertionError=function AssertionError(options){this.name="AssertionError";this.actual=options.actual;this.expected=options.expected;this.operator=options.operator;if(options.message){this.message=options.message;this.generatedMessage=false}else{this.message=getMessage(this);this.generatedMessage=true}var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace){Error.captureStackTrace(this,stackStartFunction)}else{var err=new Error;if(err.stack){var out=err.stack;var fn_name=stackStartFunction.name;var idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}};util.inherits(assert.AssertionError,Error);function replacer(key,value){if(util.isUndefined(value)){return""+value}if(util.isNumber(value)&&!isFinite(value)){return value.toString()}if(util.isFunction(value)||util.isRegExp(value)){return value.toString()}return value}function truncate(s,n){if(util.isString(s)){return s.length<n?s:s.slice(0,n)}else{return s}}function getMessage(self){return truncate(JSON.stringify(self.actual,replacer),128)+" "+self.operator+" "+truncate(JSON.stringify(self.expected,replacer),128)}function fail(actual,expected,message,operator,stackStartFunction){throw new assert.AssertionError({message:message,actual:actual,expected:expected,operator:operator,stackStartFunction:stackStartFunction})}assert.fail=fail;function ok(value,message){if(!value)fail(value,true,message,"==",assert.ok)}assert.ok=ok;assert.equal=function equal(actual,expected,message){if(actual!=expected)fail(actual,expected,message,"==",assert.equal)};assert.notEqual=function notEqual(actual,expected,message){if(actual==expected){fail(actual,expected,message,"!=",assert.notEqual)}};assert.deepEqual=function deepEqual(actual,expected,message){if(!_deepEqual(actual,expected)){fail(actual,expected,message,"deepEqual",assert.deepEqual)}};function _deepEqual(actual,expected){if(actual===expected){return true}else if(util.isBuffer(actual)&&util.isBuffer(expected)){if(actual.length!=expected.length)return false;for(var i=0;i<actual.length;i++){if(actual[i]!==expected[i])return false}return true}else if(util.isDate(actual)&&util.isDate(expected)){return actual.getTime()===expected.getTime()}else if(util.isRegExp(actual)&&util.isRegExp(expected)){return actual.source===expected.source&&actual.global===expected.global&&actual.multiline===expected.multiline&&actual.lastIndex===expected.lastIndex&&actual.ignoreCase===expected.ignoreCase}else if(!util.isObject(actual)&&!util.isObject(expected)){return actual==expected}else{return objEquiv(actual,expected)}}function isArguments(object){return Object.prototype.toString.call(object)=="[object Arguments]"}function objEquiv(a,b){if(util.isNullOrUndefined(a)||util.isNullOrUndefined(b))return false;if(a.prototype!==b.prototype)return false;if(util.isPrimitive(a)||util.isPrimitive(b)){return a===b}var aIsArgs=isArguments(a),bIsArgs=isArguments(b);if(aIsArgs&&!bIsArgs||!aIsArgs&&bIsArgs)return false;if(aIsArgs){a=pSlice.call(a);b=pSlice.call(b);return _deepEqual(a,b)}var ka=objectKeys(a),kb=objectKeys(b),key,i;if(ka.length!=kb.length)return false;ka.sort();kb.sort();for(i=ka.length-1;i>=0;i--){if(ka[i]!=kb[i])return false}for(i=ka.length-1;i>=0;i--){key=ka[i];if(!_deepEqual(a[key],b[key]))return false}return true}assert.notDeepEqual=function notDeepEqual(actual,expected,message){if(_deepEqual(actual,expected)){fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)}};assert.strictEqual=function strictEqual(actual,expected,message){if(actual!==expected){fail(actual,expected,message,"===",assert.strictEqual)}};assert.notStrictEqual=function notStrictEqual(actual,expected,message){if(actual===expected){fail(actual,expected,message,"!==",assert.notStrictEqual)}};function expectedException(actual,expected){if(!actual||!expected){return false}if(Object.prototype.toString.call(expected)=="[object RegExp]"){return expected.test(actual)}else if(actual instanceof expected){return true}else if(expected.call({},actual)===true){return true}return false}function _throws(shouldThrow,block,expected,message){var actual;if(util.isString(expected)){message=expected;expected=null}try{block()}catch(e){actual=e}message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:".");if(shouldThrow&&!actual){fail(actual,expected,"Missing expected exception"+message)}if(!shouldThrow&&expectedException(actual,expected)){fail(actual,expected,"Got unwanted exception"+message)}if(shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual){throw actual}}assert.throws=function(block,error,message){_throws.apply(this,[true].concat(pSlice.call(arguments)))};assert.doesNotThrow=function(block,message){_throws.apply(this,[false].concat(pSlice.call(arguments)))};assert.ifError=function(err){if(err){throw err}};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){if(hasOwn.call(obj,key))keys.push(key)}return keys}},{"util/":8}],3:[function(require,module,exports){function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}module.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;EventEmitter.defaultMaxListeners=10;EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");this._maxListeners=n;return this};EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(!this._events)this._events={};if(type==="error"){if(!this._events.error||isObject(this._events.error)&&!this._events.error.length){er=arguments[1];if(er instanceof Error){throw er}else{var err=new Error('Uncaught, unspecified "error" event. ('+er+")");err.context=er;throw err}}}handler=this._events[type];if(isUndefined(handler))return false;if(isFunction(handler)){switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:args=Array.prototype.slice.call(arguments,1);handler.apply(this,args)}}else if(isObject(handler)){args=Array.prototype.slice.call(arguments,1);listeners=handler.slice();len=listeners.length;for(i=0;i<len;i++)listeners[i].apply(this,args)}return true};EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener);if(!this._events[type])this._events[type]=listener;else if(isObject(this._events[type]))this._events[type].push(listener);else this._events[type]=[this._events[type],listener];if(isObject(this._events[type])&&!this._events[type].warned){if(!isUndefined(this._maxListeners)){m=this._maxListeners}else{m=EventEmitter.defaultMaxListeners}if(m&&m>0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-- >0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else if(listeners){while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;else if(evlistener)return evlistener.length}return 0};EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0; | |
}},{}],4:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")};exports.sep="/";exports.delimiter=":";exports.dirname=function(path){var result=splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir};exports.basename=function(path,ext){var f=splitPath(path)[2];if(ext&&f.substr(-1*ext.length)===ext){f=f.substr(0,f.length-ext.length)}return f};exports.extname=function(path){return splitPath(path)[3]};function filter(xs,f){if(xs.filter)return xs.filter(f);var res=[];for(var i=0;i<xs.length;i++){if(f(xs[i],i,xs))res.push(xs[i])}return res}var substr="ab".substr(-1)==="b"?function(str,start,len){return str.substr(start,len)}:function(str,start,len){if(start<0)start=str.length+start;return str.substr(start,len)}}).call(this,require("_process"))},{_process:5}],5:[function(require,module,exports){var process=module.exports={};var cachedSetTimeout;var cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){cachedSetTimeout=setTimeout}else{cachedSetTimeout=defaultSetTimout}}catch(e){cachedSetTimeout=defaultSetTimout}try{if(typeof clearTimeout==="function"){cachedClearTimeout=clearTimeout}else{cachedClearTimeout=defaultClearTimeout}}catch(e){cachedClearTimeout=defaultClearTimeout}})();function runTimeout(fun){if(cachedSetTimeout===setTimeout){return setTimeout(fun,0)}if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout){cachedSetTimeout=setTimeout;return setTimeout(fun,0)}try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout){return clearTimeout(marker)}if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout){cachedClearTimeout=clearTimeout;return clearTimeout(marker)}try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}var queue=[];var draining=false;var currentQueue;var queueIndex=-1;function cleanUpNextTick(){if(!draining||!currentQueue){return}draining=false;if(currentQueue.length){queue=currentQueue.concat(queue)}else{queueIndex=-1}if(queue.length){drainQueue()}}function drainQueue(){if(draining){return}var timeout=runTimeout(cleanUpNextTick);draining=true;var len=queue.length;while(len){currentQueue=queue;queue=[];while(++queueIndex<len){if(currentQueue){currentQueue[queueIndex].run()}}queueIndex=-1;len=queue.length}currentQueue=null;draining=false;runClearTimeout(timeout)}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1){for(var i=1;i<arguments.length;i++){args[i-1]=arguments[i]}}queue.push(new Item(fun,args));if(queue.length===1&&!draining){runTimeout(drainQueue)}};function Item(fun,array){this.fun=fun;this.array=array}Item.prototype.run=function(){this.fun.apply(null,this.array)};process.title="browser";process.browser=true;process.env={};process.argv=[];process.version="";process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")};process.umask=function(){return 0}},{}],6:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],7:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],8:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i<arguments.length;i++){objects.push(inspect(arguments[i]))}return objects.join(" ")}var i=1;var args=arguments;var len=args.length;var str=String(f).replace(formatRegExp,function(x){if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i<len;x=args[++i]){if(isNull(x)||!isObject(x)){str+=" "+x}else{str+=" "+inspect(x)}}return str};exports.deprecate=function(fn,msg){if(isUndefined(global.process)){return function(){return exports.deprecate(fn,msg).apply(this,arguments)}}if(process.noDeprecation===true){return fn}var warned=false;function deprecated(){if(!warned){if(process.throwDeprecation){throw new Error(msg)}else if(process.traceDeprecation){console.trace(msg)}else{console.error(msg)}warned=true}return fn.apply(this,arguments)}return deprecated};var debugs={};var debugEnviron;exports.debuglog=function(set){if(isUndefined(debugEnviron))debugEnviron=process.env.NODE_DEBUG||"";set=set.toUpperCase();if(!debugs[set]){if(new RegExp("\\b"+set+"\\b","i").test(debugEnviron)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else{debugs[set]=function(){}}}return debugs[set]};function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};if(arguments.length>=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i<l;++i){if(hasOwnProperty(value,String(i))){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),true))}else{output.push("")}}keys.forEach(function(key){if(!key.match(/^\d+$/)){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,true))}});return output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]};if(desc.get){if(desc.set){str=ctx.stylize("[Getter/Setter]","special")}else{str=ctx.stylize("[Getter]","special")}}else{if(desc.set){str=ctx.stylize("[Setter]","special")}}if(!hasOwnProperty(visibleKeys,key)){name="["+key+"]"}if(!str){if(ctx.seen.indexOf(desc.value)<0){if(isNull(recurseTimes)){str=formatValue(ctx,desc.value,null)}else{str=formatValue(ctx,desc.value,recurseTimes-1)}if(str.indexOf("\n")>-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":7,_process:5,inherits:6}],9:[function(require,module,exports){(function(process){exports.alphasort=alphasort;exports.alphasorti=alphasorti;exports.setopts=setopts;exports.ownProp=ownProp;exports.makeAbs=makeAbs;exports.finish=finish;exports.mark=mark;exports.isIgnored=isIgnored;exports.childrenIgnored=childrenIgnored;function ownProp(obj,field){return Object.prototype.hasOwnProperty.call(obj,field)}var path=require("path");var minimatch=require("minimatch");var isAbsolute=require("path-is-absolute");var Minimatch=minimatch.Minimatch;function alphasorti(a,b){return a.toLowerCase().localeCompare(b.toLowerCase())}function alphasort(a,b){return a.localeCompare(b)}function setupIgnores(self,options){self.ignore=options.ignore||[];if(!Array.isArray(self.ignore))self.ignore=[self.ignore];if(self.ignore.length){self.ignore=self.ignore.map(ignoreMap)}}function ignoreMap(pattern){var gmatcher=null;if(pattern.slice(-3)==="/**"){var gpattern=pattern.replace(/(\/\*\*)+$/,"");gmatcher=new Minimatch(gpattern,{dot:true})}return{matcher:new Minimatch(pattern,{dot:true}),gmatcher:gmatcher}}function setopts(self,pattern,options){if(!options)options={};if(options.matchBase&&-1===pattern.indexOf("/")){if(options.noglobstar){throw new Error("base matching requires globstar")}pattern="**/"+pattern}self.silent=!!options.silent;self.pattern=pattern;self.strict=options.strict!==false;self.realpath=!!options.realpath;self.realpathCache=options.realpathCache||Object.create(null);self.follow=!!options.follow;self.dot=!!options.dot;self.mark=!!options.mark;self.nodir=!!options.nodir;if(self.nodir)self.mark=true;self.sync=!!options.sync;self.nounique=!!options.nounique;self.nonull=!!options.nonull;self.nosort=!!options.nosort;self.nocase=!!options.nocase;self.stat=!!options.stat;self.noprocess=!!options.noprocess;self.maxLength=options.maxLength||Infinity;self.cache=options.cache||Object.create(null);self.statCache=options.statCache||Object.create(null);self.symlinks=options.symlinks||Object.create(null);setupIgnores(self,options);self.changedCwd=false;var cwd=process.cwd();if(!ownProp(options,"cwd"))self.cwd=cwd;else{self.cwd=path.resolve(options.cwd);self.changedCwd=self.cwd!==cwd}self.root=options.root||path.resolve(self.cwd,"/");self.root=path.resolve(self.root);if(process.platform==="win32")self.root=self.root.replace(/\\/g,"/");self.cwdAbs=makeAbs(self,self.cwd);self.nomount=!!options.nomount;options.nonegate=true;options.nocomment=true;self.minimatch=new Minimatch(pattern,options);self.options=self.minimatch.options}function finish(self){var nou=self.nounique;var all=nou?[]:Object.create(null);for(var i=0,l=self.matches.length;i<l;i++){var matches=self.matches[i];if(!matches||Object.keys(matches).length===0){if(self.nonull){var literal=self.minimatch.globSet[i];if(nou)all.push(literal);else all[literal]=true}}else{var m=Object.keys(matches);if(nou)all.push.apply(all,m);else m.forEach(function(m){all[m]=true})}}if(!nou)all=Object.keys(all);if(!self.nosort)all=all.sort(self.nocase?alphasorti:alphasort);if(self.mark){for(var i=0;i<all.length;i++){all[i]=self._mark(all[i])}if(self.nodir){all=all.filter(function(e){var notDir=!/\/$/.test(e);var c=self.cache[e]||self.cache[makeAbs(self,e)];if(notDir&&c)notDir=c!=="DIR"&&!Array.isArray(c);return notDir})}}if(self.ignore.length)all=all.filter(function(m){return!isIgnored(self,m)});self.found=all}function mark(self,p){var abs=makeAbs(self,p);var c=self.cache[abs];var m=p;if(c){var isDir=c==="DIR"||Array.isArray(c);var slash=p.slice(-1)==="/";if(isDir&&!slash)m+="/";else if(!isDir&&slash)m=m.slice(0,-1);if(m!==p){var mabs=makeAbs(self,m);self.statCache[mabs]=self.statCache[abs];self.cache[mabs]=self.cache[abs]}}return m}function makeAbs(self,f){var abs=f;if(f.charAt(0)==="/"){abs=path.join(self.root,f)}else if(isAbsolute(f)||f===""){abs=f}else if(self.changedCwd){abs=path.resolve(self.cwd,f)}else{abs=path.resolve(f)}if(process.platform==="win32")abs=abs.replace(/\\/g,"/");return abs}function isIgnored(self,path){if(!self.ignore.length)return false;return self.ignore.some(function(item){return item.matcher.match(path)||!!(item.gmatcher&&item.gmatcher.match(path))})}function childrenIgnored(self,path){if(!self.ignore.length)return false;return self.ignore.some(function(item){return!!(item.gmatcher&&item.gmatcher.match(path))})}}).call(this,require("_process"))},{_process:5,minimatch:15,path:4,"path-is-absolute":21}],10:[function(require,module,exports){(function(process){module.exports=realpath;realpath.realpath=realpath;realpath.sync=realpathSync;realpath.realpathSync=realpathSync;realpath.monkeypatch=monkeypatch;realpath.unmonkeypatch=unmonkeypatch;var fs=require("fs");var origRealpath=fs.realpath;var origRealpathSync=fs.realpathSync;var version=process.version;var ok=/^v[0-5]\./.test(version);var old=require("./old.js");function newError(er){return er&&er.syscall==="realpath"&&(er.code==="ELOOP"||er.code==="ENOMEM"||er.code==="ENAMETOOLONG")}function realpath(p,cache,cb){if(ok){return origRealpath(p,cache,cb)}if(typeof cache==="function"){cb=cache;cache=null}origRealpath(p,cache,function(er,result){if(newError(er)){old.realpath(p,cache,cb)}else{cb(er,result)}})}function realpathSync(p,cache){if(ok){return origRealpathSync(p,cache)}try{return origRealpathSync(p,cache)}catch(er){if(newError(er)){return old.realpathSync(p,cache)}else{throw er}}}function monkeypatch(){fs.realpath=realpath;fs.realpathSync=realpathSync}function unmonkeypatch(){fs.realpath=origRealpath;fs.realpathSync=origRealpathSync}}).call(this,require("_process"))},{"./old.js":11,_process:5,fs:1}],11:[function(require,module,exports){(function(process){var pathModule=require("path");var isWindows=process.platform==="win32";var fs=require("fs");var DEBUG=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function rethrow(){var callback;if(DEBUG){var backtrace=new Error;callback=debugCallback}else callback=missingCallback;return callback;function debugCallback(err){if(err){backtrace.message=err.message;err=backtrace;missingCallback(err)}}function missingCallback(err){if(err){if(process.throwDeprecation)throw err;else if(!process.noDeprecation){var msg="fs: missing callback "+(err.stack||err.message);if(process.traceDeprecation)console.trace(msg);else console.error(msg)}}}}function maybeCallback(cb){return typeof cb==="function"?cb:rethrow()}var normalize=pathModule.normalize;if(isWindows){var nextPartRe=/(.*?)(?:[\/\\]+|$)/g}else{var nextPartRe=/(.*?)(?:[\/]+|$)/g}if(isWindows){var splitRootRe=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/}else{var splitRootRe=/^[\/]*/}exports.realpathSync=function realpathSync(p,cache){p=pathModule.resolve(p);if(cache&&Object.prototype.hasOwnProperty.call(cache,p)){return cache[p]}var original=p,seenLinks={},knownHard={};var pos;var current;var base;var previous;start();function start(){var m=splitRootRe.exec(p);pos=m[0].length;current=m[0];base=m[0];previous="";if(isWindows&&!knownHard[base]){fs.lstatSync(base);knownHard[base]=true}}while(pos<p.length){nextPartRe.lastIndex=pos;var result=nextPartRe.exec(p);previous=current;current+=result[0];base=previous+result[1];pos=nextPartRe.lastIndex;if(knownHard[base]||cache&&cache[base]===base){continue}var resolvedLink;if(cache&&Object.prototype.hasOwnProperty.call(cache,base)){resolvedLink=cache[base]}else{var stat=fs.lstatSync(base);if(!stat.isSymbolicLink()){knownHard[base]=true;if(cache)cache[base]=base;continue}var linkTarget=null;if(!isWindows){var id=stat.dev.toString(32)+":"+stat.ino.toString(32);if(seenLinks.hasOwnProperty(id)){linkTarget=seenLinks[id]}}if(linkTarget===null){fs.statSync(base);linkTarget=fs.readlinkSync(base)}resolvedLink=pathModule.resolve(previous,linkTarget);if(cache)cache[base]=resolvedLink;if(!isWindows)seenLinks[id]=linkTarget}p=pathModule.resolve(resolvedLink,p.slice(pos));start()}if(cache)cache[original]=p;return p};exports.realpath=function realpath(p,cache,cb){if(typeof cb!=="function"){cb=maybeCallback(cache);cache=null}p=pathModule.resolve(p);if(cache&&Object.prototype.hasOwnProperty.call(cache,p)){return process.nextTick(cb.bind(null,null,cache[p]))}var original=p,seenLinks={},knownHard={};var pos;var current;var base;var previous;start();function start(){var m=splitRootRe.exec(p);pos=m[0].length;current=m[0];base=m[0];previous="";if(isWindows&&!knownHard[base]){fs.lstat(base,function(err){if(err)return cb(err);knownHard[base]=true;LOOP()})}else{process.nextTick(LOOP)}}function LOOP(){if(pos>=p.length){if(cache)cache[original]=p;return cb(null,p)}nextPartRe.lastIndex=pos;var result=nextPartRe.exec(p);previous=current;current+=result[0];base=previous+result[1];pos=nextPartRe.lastIndex;if(knownHard[base]||cache&&cache[base]===base){return process.nextTick(LOOP)}if(cache&&Object.prototype.hasOwnProperty.call(cache,base)){return gotResolvedLink(cache[base])}return fs.lstat(base,gotStat)}function gotStat(err,stat){if(err)return cb(err);if(!stat.isSymbolicLink()){knownHard[base]=true;if(cache)cache[base]=base;return process.nextTick(LOOP)}if(!isWindows){var id=stat.dev.toString(32)+":"+stat.ino.toString(32);if(seenLinks.hasOwnProperty(id)){return gotTarget(null,seenLinks[id],base)}}fs.stat(base,function(err){if(err)return cb(err);fs.readlink(base,function(err,target){if(!isWindows)seenLinks[id]=target;gotTarget(err,target)})})}function gotTarget(err,target,base){if(err)return cb(err);var resolvedLink=pathModule.resolve(previous,target);if(cache)cache[base]=resolvedLink;gotResolvedLink(resolvedLink)}function gotResolvedLink(resolvedLink){p=pathModule.resolve(resolvedLink,p.slice(pos));start()}}}).call(this,require("_process"))},{_process:5,fs:1,path:4}],12:[function(require,module,exports){(function(process){var wrappy=require("wrappy");var reqs=Object.create(null);var once=require("once");module.exports=wrappy(inflight);function inflight(key,cb){if(reqs[key]){reqs[key].push(cb);return null}else{reqs[key]=[cb];return makeres(key)}}function makeres(key){return once(function RES(){var cbs=reqs[key];var len=cbs.length;var args=slice(arguments);try{for(var i=0;i<len;i++){cbs[i].apply(null,args)}}finally{if(cbs.length>len){cbs.splice(0,len);process.nextTick(function(){RES.apply(null,args)})}else{delete reqs[key]}}})}function slice(args){var length=args.length;var array=[];for(var i=0;i<length;i++)array[i]=args[i];return array}}).call(this,require("_process"))},{_process:5,once:20,wrappy:13}],13:[function(require,module,exports){module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=="function")throw new TypeError("need wrapper function");Object.keys(fn).forEach(function(k){wrapper[k]=fn[k]});return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i]}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==="function"&&ret!==cb){Object.keys(cb).forEach(function(k){ret[k]=cb[k]})}return ret}}},{}],14:[function(require,module,exports){arguments[4][6][0].apply(exports,arguments)},{dup:6}],15:[function(require,module,exports){module.exports=minimatch;minimatch.Minimatch=Minimatch;var path={sep:"/"};try{path=require("path")}catch(er){}var GLOBSTAR=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var expand=require("brace-expansion");var plTypes={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var qmark="[^/]";var star=qmark+"*?";var twoStarDot="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var twoStarNoDot="(?:(?!(?:\\/|^)\\.).)*?";var reSpecials=charSet("().*{}+?[]^$\\!");function charSet(s){return s.split("").reduce(function(set,c){set[c]=true;return set},{})}var slashSplit=/\/+/;minimatch.filter=filter;function filter(pattern,options){options=options||{};return function(p,i,list){return minimatch(p,pattern,options)}}function ext(a,b){a=a||{};b=b||{};var t={};Object.keys(b).forEach(function(k){t[k]=b[k]});Object.keys(a).forEach(function(k){t[k]=a[k]});return t}minimatch.defaults=function(def){if(!def||!Object.keys(def).length)return minimatch;var orig=minimatch;var m=function minimatch(p,pattern,options){return orig.minimatch(p,pattern,ext(def,options))};m.Minimatch=function Minimatch(pattern,options){return new orig.Minimatch(pattern,ext(def,options))};return m};Minimatch.defaults=function(def){if(!def||!Object.keys(def).length)return Minimatch;return minimatch.defaults(def).Minimatch};function minimatch(p,pattern,options){if(typeof pattern!=="string"){throw new TypeError("glob pattern string required")}if(!options)options={};if(!options.nocomment&&pattern.charAt(0)==="#"){return false}if(pattern.trim()==="")return p==="";return new Minimatch(pattern,options).match(p)}function Minimatch(pattern,options){if(!(this instanceof Minimatch)){return new Minimatch(pattern,options)}if(typeof pattern!=="string"){throw new TypeError("glob pattern string required")}if(!options)options={};pattern=pattern.trim();if(path.sep!=="/"){pattern=pattern.split(path.sep).join("/")}this.options=options;this.set=[];this.pattern=pattern;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 pattern=this.pattern;var options=this.options;if(!options.nocomment&&pattern.charAt(0)==="#"){this.comment=true;return}if(!pattern){this.empty=true;return}this.parseNegate();var set=this.globSet=this.braceExpand();if(options.debug)this.debug=console.error;this.debug(this.pattern,set);set=this.globParts=set.map(function(s){return s.split(slashSplit)});this.debug(this.pattern,set);set=set.map(function(s,si,set){return s.map(this.parse,this)},this);this.debug(this.pattern,set);set=set.filter(function(s){return s.indexOf(false)===-1});this.debug(this.pattern,set);this.set=set}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var pattern=this.pattern;var negate=false;var options=this.options;var negateOffset=0;if(options.nonegate)return;for(var i=0,l=pattern.length;i<l&&pattern.charAt(i)==="!";i++){negate=!negate;negateOffset++}if(negateOffset)this.pattern=pattern.substr(negateOffset);this.negate=negate}minimatch.braceExpand=function(pattern,options){return braceExpand(pattern,options)};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(pattern,options){if(!options){if(this instanceof Minimatch){options=this.options}else{options={}}}pattern=typeof pattern==="undefined"?this.pattern:pattern;if(typeof pattern==="undefined"){throw new TypeError("undefined pattern")}if(options.nobrace||!pattern.match(/\{.*\}/)){return[pattern]}return expand(pattern)}Minimatch.prototype.parse=parse;var SUBPARSE={};function parse(pattern,isSub){if(pattern.length>1024*64){throw new TypeError("pattern is too long")}var options=this.options;if(!options.noglobstar&&pattern==="**")return GLOBSTAR;if(pattern==="")return"";var re="";var hasMagic=!!options.nocase;var escaping=false;var patternListStack=[];var negativeLists=[];var stateChar;var inClass=false;var reClassStart=-1;var classStart=-1;var patternStart=pattern.charAt(0)==="."?"":options.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";var self=this;function clearStateChar(){if(stateChar){switch(stateChar){case"*":re+=star;hasMagic=true;break;case"?":re+=qmark;hasMagic=true;break;default:re+="\\"+stateChar;break}self.debug("clearStateChar %j %j",stateChar,re);stateChar=false}}for(var i=0,len=pattern.length,c;i<len&&(c=pattern.charAt(i));i++){this.debug("%s %s %s %j",pattern,i,re,c);if(escaping&&reSpecials[c]){re+="\\"+c;escaping=false;continue}switch(c){case"/":return false;case"\\":clearStateChar();escaping=true;continue;case"?":case"*":case"+":case"@":case"!":this.debug("%s %s %s %j <-- stateChar",pattern,i,re,c);if(inClass){this.debug(" in class");if(c==="!"&&i===classStart+1)c="^";re+=c;continue}self.debug("call clearStateChar %j",stateChar);clearStateChar();stateChar=c;if(options.noext)clearStateChar();continue;case"(":if(inClass){re+="(";continue}if(!stateChar){re+="\\(";continue}patternListStack.push({type:stateChar,start:i-1,reStart:re.length,open:plTypes[stateChar].open,close:plTypes[stateChar].close});re+=stateChar==="!"?"(?:(?!(?:":"(?:"; | |
this.debug("plType %j %j",stateChar,re);stateChar=false;continue;case")":if(inClass||!patternListStack.length){re+="\\)";continue}clearStateChar();hasMagic=true;var pl=patternListStack.pop();re+=pl.close;if(pl.type==="!"){negativeLists.push(pl)}pl.reEnd=re.length;continue;case"|":if(inClass||!patternListStack.length||escaping){re+="\\|";escaping=false;continue}clearStateChar();re+="|";continue;case"[":clearStateChar();if(inClass){re+="\\"+c;continue}inClass=true;classStart=i;reClassStart=re.length;re+=c;continue;case"]":if(i===classStart+1||!inClass){re+="\\"+c;escaping=false;continue}if(inClass){var cs=pattern.substring(classStart+1,i);try{RegExp("["+cs+"]")}catch(er){var sp=this.parse(cs,SUBPARSE);re=re.substr(0,reClassStart)+"\\["+sp[0]+"\\]";hasMagic=hasMagic||sp[1];inClass=false;continue}}hasMagic=true;inClass=false;re+=c;continue;default:clearStateChar();if(escaping){escaping=false}else if(reSpecials[c]&&!(c==="^"&&inClass)){re+="\\"}re+=c}}if(inClass){cs=pattern.substr(classStart+1);sp=this.parse(cs,SUBPARSE);re=re.substr(0,reClassStart)+"\\["+sp[0];hasMagic=hasMagic||sp[1]}for(pl=patternListStack.pop();pl;pl=patternListStack.pop()){var tail=re.slice(pl.reStart+pl.open.length);this.debug("setting tail",re,pl);tail=tail.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(_,$1,$2){if(!$2){$2="\\"}return $1+$1+$2+"|"});this.debug("tail=%j\n %s",tail,tail,pl,re);var t=pl.type==="*"?star:pl.type==="?"?qmark:"\\"+pl.type;hasMagic=true;re=re.slice(0,pl.reStart)+t+"\\("+tail}clearStateChar();if(escaping){re+="\\\\"}var addPatternStart=false;switch(re.charAt(0)){case".":case"[":case"(":addPatternStart=true}for(var n=negativeLists.length-1;n>-1;n--){var nl=negativeLists[n];var nlBefore=re.slice(0,nl.reStart);var nlFirst=re.slice(nl.reStart,nl.reEnd-8);var nlLast=re.slice(nl.reEnd-8,nl.reEnd);var nlAfter=re.slice(nl.reEnd);nlLast+=nlAfter;var openParensBefore=nlBefore.split("(").length-1;var cleanAfter=nlAfter;for(i=0;i<openParensBefore;i++){cleanAfter=cleanAfter.replace(/\)[+*?]?/,"")}nlAfter=cleanAfter;var dollar="";if(nlAfter===""&&isSub!==SUBPARSE){dollar="$"}var newRe=nlBefore+nlFirst+nlAfter+dollar+nlLast;re=newRe}if(re!==""&&hasMagic){re="(?=.)"+re}if(addPatternStart){re=patternStart+re}if(isSub===SUBPARSE){return[re,hasMagic]}if(!hasMagic){return globUnescape(pattern)}var flags=options.nocase?"i":"";try{var regExp=new RegExp("^"+re+"$",flags)}catch(er){return new RegExp("$.")}regExp._glob=pattern;regExp._src=re;return regExp}minimatch.makeRe=function(pattern,options){return new Minimatch(pattern,options||{}).makeRe()};Minimatch.prototype.makeRe=makeRe;function makeRe(){if(this.regexp||this.regexp===false)return this.regexp;var set=this.set;if(!set.length){this.regexp=false;return this.regexp}var options=this.options;var twoStar=options.noglobstar?star:options.dot?twoStarDot:twoStarNoDot;var flags=options.nocase?"i":"";var re=set.map(function(pattern){return pattern.map(function(p){return p===GLOBSTAR?twoStar:typeof p==="string"?regExpEscape(p):p._src}).join("\\/")}).join("|");re="^(?:"+re+")$";if(this.negate)re="^(?!"+re+").*$";try{this.regexp=new RegExp(re,flags)}catch(ex){this.regexp=false}return this.regexp}minimatch.match=function(list,pattern,options){options=options||{};var mm=new Minimatch(pattern,options);list=list.filter(function(f){return mm.match(f)});if(mm.options.nonull&&!list.length){list.push(pattern)}return list};Minimatch.prototype.match=match;function match(f,partial){this.debug("match",f,this.pattern);if(this.comment)return false;if(this.empty)return f==="";if(f==="/"&&partial)return true;var options=this.options;if(path.sep!=="/"){f=f.split(path.sep).join("/")}f=f.split(slashSplit);this.debug(this.pattern,"split",f);var set=this.set;this.debug(this.pattern,"set",set);var filename;var i;for(i=f.length-1;i>=0;i--){filename=f[i];if(filename)break}for(i=0;i<set.length;i++){var pattern=set[i];var file=f;if(options.matchBase&&pattern.length===1){file=[filename]}var hit=this.matchOne(file,pattern,partial);if(hit){if(options.flipNegate)return true;return!this.negate}}if(options.flipNegate)return false;return this.negate}Minimatch.prototype.matchOne=function(file,pattern,partial){var options=this.options;this.debug("matchOne",{"this":this,file:file,pattern:pattern});this.debug("matchOne",file.length,pattern.length);for(var fi=0,pi=0,fl=file.length,pl=pattern.length;fi<fl&&pi<pl;fi++,pi++){this.debug("matchOne loop");var p=pattern[pi];var f=file[fi];this.debug(pattern,p,f);if(p===false)return false;if(p===GLOBSTAR){this.debug("GLOBSTAR",[pattern,p,f]);var fr=fi;var pr=pi+1;if(pr===pl){this.debug("** at the end");for(;fi<fl;fi++){if(file[fi]==="."||file[fi]===".."||!options.dot&&file[fi].charAt(0)===".")return false}return true}while(fr<fl){var swallowee=file[fr];this.debug("\nglobstar while",file,fr,pattern,pr,swallowee);if(this.matchOne(file.slice(fr),pattern.slice(pr),partial)){this.debug("globstar found match!",fr,fl,swallowee);return true}else{if(swallowee==="."||swallowee===".."||!options.dot&&swallowee.charAt(0)==="."){this.debug("dot detected!",file,fr,pattern,pr);break}this.debug("globstar swallow a segment, and continue");fr++}}if(partial){this.debug("\n>>> no match, partial?",file,fr,pattern,pr);if(fr===fl)return true}return false}var hit;if(typeof p==="string"){if(options.nocase){hit=f.toLowerCase()===p.toLowerCase()}else{hit=f===p}this.debug("string match",p,f,hit)}else{hit=f.match(p);this.debug("pattern match",p,f,hit)}if(!hit)return false}if(fi===fl&&pi===pl){return true}else if(fi===fl){return partial}else if(pi===pl){var emptyFileEnd=fi===fl-1&&file[fi]==="";return emptyFileEnd}throw new Error("wtf?")};function globUnescape(s){return s.replace(/\\(.)/g,"$1")}function regExpEscape(s){return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},{"brace-expansion":16,path:4}],16:[function(require,module,exports){var concatMap=require("concat-map");var balanced=require("balanced-match");module.exports=expandTop;var escSlash="\x00SLASH"+Math.random()+"\x00";var escOpen="\x00OPEN"+Math.random()+"\x00";var escClose="\x00CLOSE"+Math.random()+"\x00";var escComma="\x00COMMA"+Math.random()+"\x00";var escPeriod="\x00PERIOD"+Math.random()+"\x00";function numeric(str){return parseInt(str,10)==str?parseInt(str,10):str.charCodeAt(0)}function escapeBraces(str){return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod)}function unescapeBraces(str){return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".")}function parseCommaParts(str){if(!str)return[""];var parts=[];var m=balanced("{","}",str);if(!m)return str.split(",");var pre=m.pre;var body=m.body;var post=m.post;var p=pre.split(",");p[p.length-1]+="{"+body+"}";var postParts=parseCommaParts(post);if(post.length){p[p.length-1]+=postParts.shift();p.push.apply(p,postParts)}parts.push.apply(parts,p);return parts}function expandTop(str){if(!str)return[];if(str.substr(0,2)==="{}"){str="\\{\\}"+str.substr(2)}return expand(escapeBraces(str),true).map(unescapeBraces)}function identity(e){return e}function embrace(str){return"{"+str+"}"}function isPadded(el){return/^-?0\d/.test(el)}function lte(i,y){return i<=y}function gte(i,y){return i>=y}function expand(str,isTop){var expansions=[];var m=balanced("{","}",str);if(!m||/\$$/.test(m.pre))return[str];var isNumericSequence=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);var isAlphaSequence=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);var isSequence=isNumericSequence||isAlphaSequence;var isOptions=m.body.indexOf(",")>=0;if(!isSequence&&!isOptions){if(m.post.match(/,.*\}/)){str=m.pre+"{"+m.body+escClose+m.post;return expand(str)}return[str]}var n;if(isSequence){n=m.body.split(/\.\./)}else{n=parseCommaParts(m.body);if(n.length===1){n=expand(n[0],false).map(embrace);if(n.length===1){var post=m.post.length?expand(m.post,false):[""];return post.map(function(p){return m.pre+n[0]+p})}}}var pre=m.pre;var post=m.post.length?expand(m.post,false):[""];var N;if(isSequence){var x=numeric(n[0]);var y=numeric(n[1]);var width=Math.max(n[0].length,n[1].length);var incr=n.length==3?Math.abs(numeric(n[2])):1;var test=lte;var reverse=y<x;if(reverse){incr*=-1;test=gte}var pad=n.some(isPadded);N=[];for(var i=x;test(i,y);i+=incr){var c;if(isAlphaSequence){c=String.fromCharCode(i);if(c==="\\")c=""}else{c=String(i);if(pad){var need=width-c.length;if(need>0){var z=new Array(need+1).join("0");if(i<0)c="-"+z+c.slice(1);else c=z+c}}}N.push(c)}}else{N=concatMap(n,function(el){return expand(el,false)})}for(var j=0;j<N.length;j++){for(var k=0;k<post.length;k++){var expansion=pre+N[j]+post[k];if(!isTop||isSequence||expansion)expansions.push(expansion)}}return expansions}},{"balanced-match":17,"concat-map":18}],17:[function(require,module,exports){"use strict";module.exports=balanced;function balanced(a,b,str){if(a instanceof RegExp)a=maybeMatch(a,str);if(b instanceof RegExp)b=maybeMatch(b,str);var r=range(a,b,str);return r&&{start:r[0],end:r[1],pre:str.slice(0,r[0]),body:str.slice(r[0]+a.length,r[1]),post:str.slice(r[1]+b.length)}}function maybeMatch(reg,str){var m=str.match(reg);return m?m[0]:null}balanced.range=range;function range(a,b,str){var begs,beg,left,right,result;var ai=str.indexOf(a);var bi=str.indexOf(b,ai+1);var i=ai;if(ai>=0&&bi>0){begs=[];left=str.length;while(i>=0&&!result){if(i==ai){begs.push(i);ai=str.indexOf(a,i+1)}else if(begs.length==1){result=[begs.pop(),bi]}else{beg=begs.pop();if(beg<left){left=beg;right=bi}bi=str.indexOf(b,i+1)}i=ai<bi&&ai>=0?ai:bi}if(begs.length){result=[left,right]}}return result}},{}],18:[function(require,module,exports){module.exports=function(xs,fn){var res=[];for(var i=0;i<xs.length;i++){var x=fn(xs[i],i);if(isArray(x))res.push.apply(res,x);else res.push(x)}return res};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==="[object Array]"}},{}],19:[function(require,module,exports){arguments[4][13][0].apply(exports,arguments)},{dup:13}],20:[function(require,module,exports){var wrappy=require("wrappy");module.exports=wrappy(once);module.exports.strict=wrappy(onceStrict);once.proto=once(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:true})});function once(fn){var f=function(){if(f.called)return f.value;f.called=true;return f.value=fn.apply(this,arguments)};f.called=false;return f}function onceStrict(fn){var f=function(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=fn.apply(this,arguments)};var name=fn.name||"Function wrapped with `once`";f.onceError=name+" shouldn't be called more than once";f.called=false;return f}},{wrappy:19}],21:[function(require,module,exports){(function(process){"use strict";function posix(path){return path.charAt(0)==="/"}function win32(path){var splitDeviceRe=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var result=splitDeviceRe.exec(path);var device=result[1]||"";var isUnc=Boolean(device&&device.charAt(1)!==":");return Boolean(result[2]||isUnc)}module.exports=process.platform==="win32"?win32:posix;module.exports.posix=posix;module.exports.win32=win32}).call(this,require("_process"))},{_process:5}],22:[function(require,module,exports){(function(process){module.exports=globSync;globSync.GlobSync=GlobSync;var fs=require("fs");var rp=require("fs.realpath");var minimatch=require("minimatch");var Minimatch=minimatch.Minimatch;var Glob=require("./glob.js").Glob;var util=require("util");var path=require("path");var assert=require("assert");var isAbsolute=require("path-is-absolute");var common=require("./common.js");var alphasort=common.alphasort;var alphasorti=common.alphasorti;var setopts=common.setopts;var ownProp=common.ownProp;var childrenIgnored=common.childrenIgnored;function globSync(pattern,options){if(typeof options==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");return new GlobSync(pattern,options).found}function GlobSync(pattern,options){if(!pattern)throw new Error("must provide pattern");if(typeof options==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof GlobSync))return new GlobSync(pattern,options);setopts(this,pattern,options);if(this.noprocess)return this;var n=this.minimatch.set.length;this.matches=new Array(n);for(var i=0;i<n;i++){this._process(this.minimatch.set[i],i,false)}this._finish()}GlobSync.prototype._finish=function(){assert(this instanceof GlobSync);if(this.realpath){var self=this;this.matches.forEach(function(matchset,index){var set=self.matches[index]=Object.create(null);for(var p in matchset){try{p=self._makeAbs(p);var real=rp.realpathSync(p,self.realpathCache);set[real]=true}catch(er){if(er.syscall==="stat")set[self._makeAbs(p)]=true;else throw er}}})}common.finish(this)};GlobSync.prototype._process=function(pattern,index,inGlobStar){assert(this instanceof GlobSync);var n=0;while(typeof pattern[n]==="string"){n++}var prefix;switch(n){case pattern.length:this._processSimple(pattern.join("/"),index);return;case 0:prefix=null;break;default:prefix=pattern.slice(0,n).join("/");break}var remain=pattern.slice(n);var read;if(prefix===null)read=".";else if(isAbsolute(prefix)||isAbsolute(pattern.join("/"))){if(!prefix||!isAbsolute(prefix))prefix="/"+prefix;read=prefix}else read=prefix;var abs=this._makeAbs(read);if(childrenIgnored(this,read))return;var isGlobStar=remain[0]===minimatch.GLOBSTAR;if(isGlobStar)this._processGlobStar(prefix,read,abs,remain,index,inGlobStar);else this._processReaddir(prefix,read,abs,remain,index,inGlobStar)};GlobSync.prototype._processReaddir=function(prefix,read,abs,remain,index,inGlobStar){var entries=this._readdir(abs,inGlobStar);if(!entries)return;var pn=remain[0];var negate=!!this.minimatch.negate;var rawGlob=pn._glob;var dotOk=this.dot||rawGlob.charAt(0)===".";var matchedEntries=[];for(var i=0;i<entries.length;i++){var e=entries[i];if(e.charAt(0)!=="."||dotOk){var m;if(negate&&!prefix){m=!e.match(pn)}else{m=e.match(pn)}if(m)matchedEntries.push(e)}}var len=matchedEntries.length;if(len===0)return;if(remain.length===1&&!this.mark&&!this.stat){if(!this.matches[index])this.matches[index]=Object.create(null);for(var i=0;i<len;i++){var e=matchedEntries[i];if(prefix){if(prefix.slice(-1)!=="/")e=prefix+"/"+e;else e=prefix+e}if(e.charAt(0)==="/"&&!this.nomount){e=path.join(this.root,e)}this.matches[index][e]=true}return}remain.shift();for(var i=0;i<len;i++){var e=matchedEntries[i];var newPattern;if(prefix)newPattern=[prefix,e];else newPattern=[e];this._process(newPattern.concat(remain),index,inGlobStar)}};GlobSync.prototype._emitMatch=function(index,e){var abs=this._makeAbs(e);if(this.mark)e=this._mark(e);if(this.matches[index][e])return;if(this.nodir){var c=this.cache[this._makeAbs(e)];if(c==="DIR"||Array.isArray(c))return}this.matches[index][e]=true;if(this.stat)this._stat(e)};GlobSync.prototype._readdirInGlobStar=function(abs){if(this.follow)return this._readdir(abs,false);var entries;var lstat;var stat;try{lstat=fs.lstatSync(abs)}catch(er){return null}var isSym=lstat.isSymbolicLink();this.symlinks[abs]=isSym;if(!isSym&&!lstat.isDirectory())this.cache[abs]="FILE";else entries=this._readdir(abs,false);return entries};GlobSync.prototype._readdir=function(abs,inGlobStar){var entries;if(inGlobStar&&!ownProp(this.symlinks,abs))return this._readdirInGlobStar(abs);if(ownProp(this.cache,abs)){var c=this.cache[abs];if(!c||c==="FILE")return null;if(Array.isArray(c))return c}try{return this._readdirEntries(abs,fs.readdirSync(abs))}catch(er){this._readdirError(abs,er);return null}};GlobSync.prototype._readdirEntries=function(abs,entries){if(!this.mark&&!this.stat){for(var i=0;i<entries.length;i++){var e=entries[i];if(abs==="/")e=abs+e;else e=abs+"/"+e;this.cache[e]=true}}this.cache[abs]=entries;return entries};GlobSync.prototype._readdirError=function(f,er){switch(er.code){case"ENOTSUP":case"ENOTDIR":var abs=this._makeAbs(f);this.cache[abs]="FILE";if(abs===this.cwdAbs){var error=new Error(er.code+" invalid cwd "+this.cwd);error.path=this.cwd;error.code=er.code;throw error}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(f)]=false;break;default:this.cache[this._makeAbs(f)]=false;if(this.strict)throw er;if(!this.silent)console.error("glob error",er);break}};GlobSync.prototype._processGlobStar=function(prefix,read,abs,remain,index,inGlobStar){var entries=this._readdir(abs,inGlobStar);if(!entries)return;var remainWithoutGlobStar=remain.slice(1);var gspref=prefix?[prefix]:[];var noGlobStar=gspref.concat(remainWithoutGlobStar);this._process(noGlobStar,index,false);var len=entries.length;var isSym=this.symlinks[abs];if(isSym&&inGlobStar)return;for(var i=0;i<len;i++){var e=entries[i];if(e.charAt(0)==="."&&!this.dot)continue;var instead=gspref.concat(entries[i],remainWithoutGlobStar);this._process(instead,index,true);var below=gspref.concat(entries[i],remain);this._process(below,index,true)}};GlobSync.prototype._processSimple=function(prefix,index){var exists=this._stat(prefix);if(!this.matches[index])this.matches[index]=Object.create(null);if(!exists)return;if(prefix&&isAbsolute(prefix)&&!this.nomount){var trail=/[\/\\]$/.test(prefix);if(prefix.charAt(0)==="/"){prefix=path.join(this.root,prefix)}else{prefix=path.resolve(this.root,prefix);if(trail)prefix+="/"}}if(process.platform==="win32")prefix=prefix.replace(/\\/g,"/");this.matches[index][prefix]=true};GlobSync.prototype._stat=function(f){var abs=this._makeAbs(f);var needDir=f.slice(-1)==="/";if(f.length>this.maxLength)return false;if(!this.stat&&ownProp(this.cache,abs)){var c=this.cache[abs];if(Array.isArray(c))c="DIR";if(!needDir||c==="DIR")return c;if(needDir&&c==="FILE")return false}var exists;var stat=this.statCache[abs];if(!stat){var lstat;try{lstat=fs.lstatSync(abs)}catch(er){return false}if(lstat.isSymbolicLink()){try{stat=fs.statSync(abs)}catch(er){stat=lstat}}else{stat=lstat}}this.statCache[abs]=stat;var c=stat.isDirectory()?"DIR":"FILE";this.cache[abs]=this.cache[abs]||c;if(needDir&&c!=="DIR")return false;return c};GlobSync.prototype._mark=function(p){return common.mark(this,p)};GlobSync.prototype._makeAbs=function(f){return common.makeAbs(this,f)}}).call(this,require("_process"))},{"./common.js":9,"./glob.js":"glob",_process:5,assert:2,fs:1,"fs.realpath":10,minimatch:15,path:4,"path-is-absolute":21,util:8}],glob:[function(require,module,exports){(function(process){module.exports=glob;var fs=require("fs");var rp=require("fs.realpath");var minimatch=require("minimatch");var Minimatch=minimatch.Minimatch;var inherits=require("inherits");var EE=require("events").EventEmitter;var path=require("path");var assert=require("assert");var isAbsolute=require("path-is-absolute");var globSync=require("./sync.js");var common=require("./common.js");var alphasort=common.alphasort;var alphasorti=common.alphasorti;var setopts=common.setopts;var ownProp=common.ownProp;var inflight=require("inflight");var util=require("util");var childrenIgnored=common.childrenIgnored;var isIgnored=common.isIgnored;var once=require("once");function glob(pattern,options,cb){if(typeof options==="function")cb=options,options={};if(!options)options={};if(options.sync){if(cb)throw new TypeError("callback provided to sync glob");return globSync(pattern,options)}return new Glob(pattern,options,cb)}glob.sync=globSync;var GlobSync=glob.GlobSync=globSync.GlobSync;glob.glob=glob;function extend(origin,add){if(add===null||typeof add!=="object"){return origin}var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin}glob.hasMagic=function(pattern,options_){var options=extend({},options_);options.noprocess=true;var g=new Glob(pattern,options);var set=g.minimatch.set;if(!pattern)return false;if(set.length>1)return true;for(var j=0;j<set[0].length;j++){if(typeof set[0][j]!=="string")return true}return false};glob.Glob=Glob;inherits(Glob,EE);function Glob(pattern,options,cb){if(typeof options==="function"){cb=options;options=null}if(options&&options.sync){if(cb)throw new TypeError("callback provided to sync glob");return new GlobSync(pattern,options)}if(!(this instanceof Glob))return new Glob(pattern,options,cb);setopts(this,pattern,options);this._didRealPath=false;var n=this.minimatch.set.length;this.matches=new Array(n);if(typeof cb==="function"){cb=once(cb);this.on("error",cb);this.on("end",function(matches){cb(null,matches)})}var self=this;var n=this.minimatch.set.length;this._processing=0;this.matches=new Array(n);this._emitQueue=[];this._processQueue=[];this.paused=false;if(this.noprocess)return this;if(n===0)return done();var sync=true;for(var i=0;i<n;i++){this._process(this.minimatch.set[i],i,false,done)}sync=false;function done(){--self._processing;if(self._processing<=0){if(sync){process.nextTick(function(){self._finish()})}else{self._finish()}}}}Glob.prototype._finish=function(){assert(this instanceof Glob);if(this.aborted)return;if(this.realpath&&!this._didRealpath)return this._realpath();common.finish(this);this.emit("end",this.found)};Glob.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=true;var n=this.matches.length;if(n===0)return this._finish();var self=this;for(var i=0;i<this.matches.length;i++)this._realpathSet(i,next);function next(){if(--n===0)self._finish()}};Glob.prototype._realpathSet=function(index,cb){var matchset=this.matches[index];if(!matchset)return cb();var found=Object.keys(matchset);var self=this;var n=found.length;if(n===0)return cb();var set=this.matches[index]=Object.create(null);found.forEach(function(p,i){p=self._makeAbs(p);rp.realpath(p,self.realpathCache,function(er,real){if(!er)set[real]=true;else if(er.syscall==="stat")set[p]=true;else self.emit("error",er);if(--n===0){self.matches[index]=set;cb()}})})};Glob.prototype._mark=function(p){return common.mark(this,p)};Glob.prototype._makeAbs=function(f){return common.makeAbs(this,f)};Glob.prototype.abort=function(){this.aborted=true;this.emit("abort")};Glob.prototype.pause=function(){if(!this.paused){this.paused=true;this.emit("pause")}};Glob.prototype.resume=function(){if(this.paused){this.emit("resume");this.paused=false;if(this._emitQueue.length){var eq=this._emitQueue.slice(0);this._emitQueue.length=0;for(var i=0;i<eq.length;i++){var e=eq[i];this._emitMatch(e[0],e[1])}}if(this._processQueue.length){var pq=this._processQueue.slice(0);this._processQueue.length=0;for(var i=0;i<pq.length;i++){var p=pq[i];this._processing--;this._process(p[0],p[1],p[2],p[3])}}}};Glob.prototype._process=function(pattern,index,inGlobStar,cb){assert(this instanceof Glob);assert(typeof cb==="function");if(this.aborted)return;this._processing++;if(this.paused){this._processQueue.push([pattern,index,inGlobStar,cb]);return}var n=0;while(typeof pattern[n]==="string"){n++}var prefix;switch(n){case pattern.length:this._processSimple(pattern.join("/"),index,cb);return;case 0:prefix=null;break;default:prefix=pattern.slice(0,n).join("/");break}var remain=pattern.slice(n);var read;if(prefix===null)read=".";else if(isAbsolute(prefix)||isAbsolute(pattern.join("/"))){if(!prefix||!isAbsolute(prefix))prefix="/"+prefix;read=prefix}else read=prefix;var abs=this._makeAbs(read);if(childrenIgnored(this,read))return cb();var isGlobStar=remain[0]===minimatch.GLOBSTAR;if(isGlobStar)this._processGlobStar(prefix,read,abs,remain,index,inGlobStar,cb);else this._processReaddir(prefix,read,abs,remain,index,inGlobStar,cb)};Glob.prototype._processReaddir=function(prefix,read,abs,remain,index,inGlobStar,cb){var self=this;this._readdir(abs,inGlobStar,function(er,entries){return self._processReaddir2(prefix,read,abs,remain,index,inGlobStar,entries,cb)})};Glob.prototype._processReaddir2=function(prefix,read,abs,remain,index,inGlobStar,entries,cb){if(!entries)return cb();var pn=remain[0];var negate=!!this.minimatch.negate;var rawGlob=pn._glob;var dotOk=this.dot||rawGlob.charAt(0)===".";var matchedEntries=[];for(var i=0;i<entries.length;i++){var e=entries[i];if(e.charAt(0)!=="."||dotOk){var m;if(negate&&!prefix){m=!e.match(pn)}else{m=e.match(pn)}if(m)matchedEntries.push(e)}}var len=matchedEntries.length;if(len===0)return cb();if(remain.length===1&&!this.mark&&!this.stat){if(!this.matches[index])this.matches[index]=Object.create(null);for(var i=0;i<len;i++){var e=matchedEntries[i];if(prefix){if(prefix!=="/")e=prefix+"/"+e;else e=prefix+e}if(e.charAt(0)==="/"&&!this.nomount){e=path.join(this.root,e)}this._emitMatch(index,e)}return cb()}remain.shift();for(var i=0;i<len;i++){var e=matchedEntries[i];var newPattern;if(prefix){if(prefix!=="/")e=prefix+"/"+e;else e=prefix+e}this._process([e].concat(remain),index,inGlobStar,cb)}cb()};Glob.prototype._emitMatch=function(index,e){if(this.aborted)return;if(this.matches[index][e])return;if(isIgnored(this,e))return;if(this.paused){this._emitQueue.push([index,e]);return}var abs=this._makeAbs(e);if(this.nodir){var c=this.cache[abs];if(c==="DIR"||Array.isArray(c))return}if(this.mark)e=this._mark(e);this.matches[index][e]=true;var st=this.statCache[abs];if(st)this.emit("stat",e,st);this.emit("match",e)};Glob.prototype._readdirInGlobStar=function(abs,cb){if(this.aborted)return;if(this.follow)return this._readdir(abs,false,cb);var lstatkey="lstat\x00"+abs;var self=this;var lstatcb=inflight(lstatkey,lstatcb_);if(lstatcb)fs.lstat(abs,lstatcb);function lstatcb_(er,lstat){if(er)return cb();var isSym=lstat.isSymbolicLink();self.symlinks[abs]=isSym;if(!isSym&&!lstat.isDirectory()){self.cache[abs]="FILE";cb()}else self._readdir(abs,false,cb)}};Glob.prototype._readdir=function(abs,inGlobStar,cb){if(this.aborted)return;cb=inflight("readdir\x00"+abs+"\x00"+inGlobStar,cb);if(!cb)return;if(inGlobStar&&!ownProp(this.symlinks,abs))return this._readdirInGlobStar(abs,cb);if(ownProp(this.cache,abs)){var c=this.cache[abs];if(!c||c==="FILE")return cb();if(Array.isArray(c))return cb(null,c)}var self=this;fs.readdir(abs,readdirCb(this,abs,cb))};function readdirCb(self,abs,cb){return function(er,entries){if(er)self._readdirError(abs,er,cb);else self._readdirEntries(abs,entries,cb)}}Glob.prototype._readdirEntries=function(abs,entries,cb){if(this.aborted)return;if(!this.mark&&!this.stat){for(var i=0;i<entries.length;i++){var e=entries[i];if(abs==="/")e=abs+e;else e=abs+"/"+e;this.cache[e]=true}}this.cache[abs]=entries;return cb(null,entries)};Glob.prototype._readdirError=function(f,er,cb){if(this.aborted)return;switch(er.code){case"ENOTSUP":case"ENOTDIR":var abs=this._makeAbs(f);this.cache[abs]="FILE";if(abs===this.cwdAbs){var error=new Error(er.code+" invalid cwd "+this.cwd);error.path=this.cwd;error.code=er.code;this.emit("error",error);this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(f)]=false;break;default:this.cache[this._makeAbs(f)]=false;if(this.strict){this.emit("error",er);this.abort()}if(!this.silent)console.error("glob error",er);break}return cb()};Glob.prototype._processGlobStar=function(prefix,read,abs,remain,index,inGlobStar,cb){var self=this;this._readdir(abs,inGlobStar,function(er,entries){self._processGlobStar2(prefix,read,abs,remain,index,inGlobStar,entries,cb)})};Glob.prototype._processGlobStar2=function(prefix,read,abs,remain,index,inGlobStar,entries,cb){if(!entries)return cb();var remainWithoutGlobStar=remain.slice(1);var gspref=prefix?[prefix]:[];var noGlobStar=gspref.concat(remainWithoutGlobStar);this._process(noGlobStar,index,false,cb);var isSym=this.symlinks[abs];var len=entries.length;if(isSym&&inGlobStar)return cb();for(var i=0;i<len;i++){var e=entries[i];if(e.charAt(0)==="."&&!this.dot)continue;var instead=gspref.concat(entries[i],remainWithoutGlobStar);this._process(instead,index,true,cb);var below=gspref.concat(entries[i],remain);this._process(below,index,true,cb)}cb()};Glob.prototype._processSimple=function(prefix,index,cb){var self=this;this._stat(prefix,function(er,exists){self._processSimple2(prefix,index,er,exists,cb)})};Glob.prototype._processSimple2=function(prefix,index,er,exists,cb){if(!this.matches[index])this.matches[index]=Object.create(null);if(!exists)return cb();if(prefix&&isAbsolute(prefix)&&!this.nomount){var trail=/[\/\\]$/.test(prefix);if(prefix.charAt(0)==="/"){prefix=path.join(this.root,prefix)}else{prefix=path.resolve(this.root,prefix);if(trail)prefix+="/"}}if(process.platform==="win32")prefix=prefix.replace(/\\/g,"/");this._emitMatch(index,prefix);cb()};Glob.prototype._stat=function(f,cb){var abs=this._makeAbs(f);var needDir=f.slice(-1)==="/";if(f.length>this.maxLength)return cb();if(!this.stat&&ownProp(this.cache,abs)){var c=this.cache[abs];if(Array.isArray(c))c="DIR";if(!needDir||c==="DIR")return cb(null,c);if(needDir&&c==="FILE")return cb()}var exists;var stat=this.statCache[abs];if(stat!==undefined){if(stat===false)return cb(null,stat);else{var type=stat.isDirectory()?"DIR":"FILE";if(needDir&&type==="FILE")return cb();else return cb(null,type,stat)}}var self=this;var statcb=inflight("stat\x00"+abs,lstatcb_);if(statcb)fs.lstat(abs,statcb);function lstatcb_(er,lstat){if(lstat&&lstat.isSymbolicLink()){return fs.stat(abs,function(er,stat){if(er)self._stat2(f,abs,null,lstat,cb);else self._stat2(f,abs,er,stat,cb)})}else{self._stat2(f,abs,er,lstat,cb)}}};Glob.prototype._stat2=function(f,abs,er,stat,cb){if(er){this.statCache[abs]=false;return cb()}var needDir=f.slice(-1)==="/";this.statCache[abs]=stat;if(abs.slice(-1)==="/"&&!stat.isDirectory())return cb(null,false,stat);var c=stat.isDirectory()?"DIR":"FILE";this.cache[abs]=this.cache[abs]||c;if(needDir&&c!=="DIR")return cb();return cb(null,c,stat)}}).call(this,require("_process"))},{"./common.js":9,"./sync.js":22,_process:5,assert:2,events:3,fs:1,"fs.realpath":10,inflight:12,inherits:14,minimatch:15,once:20,path:4,"path-is-absolute":21,util:8}]},{},[]);const glob=require("glob");var minimatch=require("minimatch");console.log(glob.hasMagic("/home/seba/dev/home/home-app/.meteor/local/!(db)"))},0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "requirebin-sketch", | |
"version": "1.0.0", | |
"dependencies": { | |
"minimatch": "3.0.3", | |
"glob": "7.0.6" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- contents of this file will be placed inside the <body> --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- contents of this file will be placed inside the <head> --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment