1 (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.minimatch = f()}})(function(){var define,module,exports;return (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 module.exports = minimatch
3 minimatch.Minimatch = Minimatch
5 var path = { sep: '/' }
10 var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
11 var expand = require('brace-expansion')
13 // any single thing other than /
14 // don't need to escape / when using new RegExp()
17 // * => any number of characters
18 var star = qmark + '*?'
20 // ** when dots are allowed. Anything goes, except .. and .
21 // not (^ or / followed by one or two dots followed by $ or /),
22 // followed by anything, any number of times.
23 var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'
25 // not a ^ or / followed by a dot,
26 // followed by anything, any number of times.
27 var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'
29 // characters that need to be escaped in RegExp.
30 var reSpecials = charSet('().*{}+?[]^$\\!')
32 // "abc" -> { a:true, b:true, c:true }
33 function charSet (s) {
34 return s.split('').reduce(function (set, c) {
40 // normalizes slashes.
41 var slashSplit = /\/+/
43 minimatch.filter = filter
44 function filter (pattern, options) {
45 options = options || {}
46 return function (p, i, list) {
47 return minimatch(p, pattern, options)
55 Object.keys(b).forEach(function (k) {
58 Object.keys(a).forEach(function (k) {
64 minimatch.defaults = function (def) {
65 if (!def || !Object.keys(def).length) return minimatch
69 var m = function minimatch (p, pattern, options) {
70 return orig.minimatch(p, pattern, ext(def, options))
73 m.Minimatch = function Minimatch (pattern, options) {
74 return new orig.Minimatch(pattern, ext(def, options))
80 Minimatch.defaults = function (def) {
81 if (!def || !Object.keys(def).length) return Minimatch
82 return minimatch.defaults(def).Minimatch
85 function minimatch (p, pattern, options) {
86 if (typeof pattern !== 'string') {
87 throw new TypeError('glob pattern string required')
90 if (!options) options = {}
92 // shortcut: comments match nothing.
93 if (!options.nocomment && pattern.charAt(0) === '#') {
98 if (pattern.trim() === '') return p === ''
100 return new Minimatch(pattern, options).match(p)
103 function Minimatch (pattern, options) {
104 if (!(this instanceof Minimatch)) {
105 return new Minimatch(pattern, options)
108 if (typeof pattern !== 'string') {
109 throw new TypeError('glob pattern string required')
112 if (!options) options = {}
113 pattern = pattern.trim()
115 // windows support: need to use /, not \
116 if (path.sep !== '/') {
117 pattern = pattern.split(path.sep).join('/')
120 this.options = options
122 this.pattern = pattern
128 // make the set of regexps etc.
132 Minimatch.prototype.debug = function () {}
134 Minimatch.prototype.make = make
136 // don't do it more than once.
137 if (this._made) return
139 var pattern = this.pattern
140 var options = this.options
142 // empty patterns and comments match nothing.
143 if (!options.nocomment && pattern.charAt(0) === '#') {
152 // step 1: figure out negation, etc.
155 // step 2: expand braces
156 var set = this.globSet = this.braceExpand()
158 if (options.debug) this.debug = console.error
160 this.debug(this.pattern, set)
162 // step 3: now we have a set, so turn each one into a series of path-portion
163 // matching patterns.
164 // These will be regexps, except in the case of "**", which is
165 // set to the GLOBSTAR object for globstar behavior,
166 // and will not contain any / characters
167 set = this.globParts = set.map(function (s) {
168 return s.split(slashSplit)
171 this.debug(this.pattern, set)
174 set = set.map(function (s, si, set) {
175 return s.map(this.parse, this)
178 this.debug(this.pattern, set)
180 // filter out everything that didn't compile properly.
181 set = set.filter(function (s) {
182 return s.indexOf(false) === -1
185 this.debug(this.pattern, set)
190 Minimatch.prototype.parseNegate = parseNegate
191 function parseNegate () {
192 var pattern = this.pattern
194 var options = this.options
197 if (options.nonegate) return
199 for (var i = 0, l = pattern.length
200 ; i < l && pattern.charAt(i) === '!'
206 if (negateOffset) this.pattern = pattern.substr(negateOffset)
211 // a{b,c}d -> abd acd
213 // a{0..3}d -> a0d a1d a2d a3d
214 // a{b,c{d,e}f}g -> abg acdfg acefg
215 // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
217 // Invalid sets are not expanded.
218 // a{2..}b -> a{2..}b
220 minimatch.braceExpand = function (pattern, options) {
221 return braceExpand(pattern, options)
224 Minimatch.prototype.braceExpand = braceExpand
226 function braceExpand (pattern, options) {
228 if (this instanceof Minimatch) {
229 options = this.options
235 pattern = typeof pattern === 'undefined'
236 ? this.pattern : pattern
238 if (typeof pattern === 'undefined') {
239 throw new Error('undefined pattern')
242 if (options.nobrace ||
243 !pattern.match(/\{.*\}/)) {
244 // shortcut. no need to expand.
248 return expand(pattern)
251 // parse a component of the expanded set.
252 // At this point, no pattern may contain "/" in it
253 // so we're going to return a 2d array, where each entry is the full
254 // pattern, split on '/', and then turned into a regular expression.
255 // A regexp is made at the end which joins each array with an
256 // escaped /, and another full one which joins each regexp with |.
258 // Following the lead of Bash 4.1, note that "**" only has special meaning
259 // when it is the *only* thing in a path portion. Otherwise, any series
260 // of * is equivalent to a single *. Globstar behavior is enabled by
261 // default, and can be disabled by setting options.noglobstar.
262 Minimatch.prototype.parse = parse
264 function parse (pattern, isSub) {
265 var options = this.options
268 if (!options.noglobstar && pattern === '**') return GLOBSTAR
269 if (pattern === '') return ''
272 var hasMagic = !!options.nocase
274 // ? => one single character
275 var patternListStack = []
276 var negativeLists = []
280 var reClassStart = -1
282 // . and .. never match anything that doesn't start with .,
283 // even when options.dot is set.
284 var patternStart = pattern.charAt(0) === '.' ? '' // anything
285 // not (start or / followed by . or .. followed by / or end)
286 : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
290 function clearStateChar () {
292 // we had some state-tracking character
293 // that wasn't consumed by this pass.
304 re += '\\' + stateChar
307 self.debug('clearStateChar %j %j', stateChar, re)
312 for (var i = 0, len = pattern.length, c
313 ; (i < len) && (c = pattern.charAt(i))
315 this.debug('%s\t%s %s %j', pattern, i, re, c)
317 // skip over any that are escaped.
318 if (escaping && reSpecials[c]) {
326 // completely not allowed, even escaped.
327 // Should already be path-split by now.
335 // the various stateChar values
336 // for the "extglob" stuff.
342 this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
344 // all of those are literals inside a class, except that
345 // the glob [!a] means [^a] in regexp
347 this.debug(' in class')
348 if (c === '!' && i === classStart + 1) c = '^'
353 // if we already have a stateChar, then it means
354 // that there was something like ** or +? in there.
355 // Handle the stateChar, then proceed with this one.
356 self.debug('call clearStateChar %j', stateChar)
359 // if extglob is disabled, then +(asdf|foo) isn't a thing.
360 // just clear the statechar *now*, rather than even diving into
361 // the patternList stuff.
362 if (options.noext) clearStateChar()
377 patternListStack.push({
382 // negation is (?:(?!js)[^/]*)
383 re += stateChar === '!' ? '(?:(?!(?:' : '(?:'
384 this.debug('plType %j %j', stateChar, re)
389 if (inClass || !patternListStack.length) {
397 var pl = patternListStack.pop()
399 // negation is (?:(?!js)[^/]*)
400 // The others are (?:<pattern>)<type>
403 negativeLists.push(pl)
412 case '@': break // the default anyway
417 if (inClass || !patternListStack.length || escaping) {
427 // these are mostly the same in regexp and glob
429 // swallow any state-tracking char before the [
439 reClassStart = re.length
444 // a right bracket shall lose its special
445 // meaning and represent itself in
446 // a bracket expression if it occurs
447 // first in the list. -- POSIX.2 2.8.3.2
448 if (i === classStart + 1 || !inClass) {
454 // handle the case where we left a class open.
455 // "[z-a]" is valid, equivalent to "\[z-a\]"
457 // split where the last [ was, make sure we don't have
458 // an invalid re. if so, re-walk the contents of the
459 // would-be class to re-translate any characters that
460 // were passed through as-is
461 // TODO: It would probably be faster to determine this
462 // without a try/catch and a new RegExp, but it's tricky
463 // to do safely. For now, this is safe and works.
464 var cs = pattern.substring(classStart + 1, i)
466 RegExp('[' + cs + ']')
468 // not a valid class!
469 var sp = this.parse(cs, SUBPARSE)
470 re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
471 hasMagic = hasMagic || sp[1]
477 // finish up the class.
484 // swallow any state char that wasn't consumed
490 } else if (reSpecials[c]
491 && !(c === '^' && inClass)) {
500 // handle the case where we left a class open.
501 // "[abc" is valid, equivalent to "\[abc"
503 // split where the last [ was, and escape it
504 // this is a huge pita. We now have to re-walk
505 // the contents of the would-be class to re-translate
506 // any characters that were passed through as-is
507 cs = pattern.substr(classStart + 1)
508 sp = this.parse(cs, SUBPARSE)
509 re = re.substr(0, reClassStart) + '\\[' + sp[0]
510 hasMagic = hasMagic || sp[1]
513 // handle the case where we had a +( thing at the *end*
515 // each pattern list stack adds 3 chars, and we need to go through
516 // and escape any | chars that were passed through as-is for the regexp.
517 // Go through and escape them, taking care not to double-escape any
518 // | chars that were already escaped.
519 for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
520 var tail = re.slice(pl.reStart + 3)
521 // maybe some even number of \, then maybe 1 \, followed by a |
522 tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) {
524 // the | isn't already escaped, so escape it.
528 // need to escape all those slashes *again*, without escaping the
529 // one that we need for escaping the | character. As it works out,
530 // escaping an even number of slashes can be done by simply repeating
531 // it exactly after itself. That's why this trick works.
533 // I am sorry that you have to see this.
534 return $1 + $1 + $2 + '|'
537 this.debug('tail=%j\n %s', tail, tail)
538 var t = pl.type === '*' ? star
539 : pl.type === '?' ? qmark
543 re = re.slice(0, pl.reStart) + t + '\\(' + tail
546 // handle trailing things that only matter at the very end.
553 // only need to apply the nodot start if the re starts with
554 // something that could conceivably capture a dot
555 var addPatternStart = false
556 switch (re.charAt(0)) {
559 case '(': addPatternStart = true
562 // Hack to work around lack of negative lookbehind in JS
563 // A pattern like: *.!(x).!(y|z) needs to ensure that a name
564 // like 'a.xyz.yz' doesn't match. So, the first negative
565 // lookahead, has to look ALL the way ahead, to the end of
567 for (var n = negativeLists.length - 1; n > -1; n--) {
568 var nl = negativeLists[n]
570 var nlBefore = re.slice(0, nl.reStart)
571 var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
572 var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)
573 var nlAfter = re.slice(nl.reEnd)
577 // Handle nested stuff like *(*.js|!(*.json)), where open parens
578 // mean that we should *not* include the ) in the bit that is considered
579 // "after" the negated section.
580 var openParensBefore = nlBefore.split('(').length - 1
581 var cleanAfter = nlAfter
582 for (i = 0; i < openParensBefore; i++) {
583 cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
588 if (nlAfter === '' && isSub !== SUBPARSE) {
591 var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast
595 // if the re is not "" at this point, then we need to make sure
596 // it doesn't match against an empty path part.
597 // Otherwise a/* will match a/, which it should not.
598 if (re !== '' && hasMagic) {
602 if (addPatternStart) {
603 re = patternStart + re
606 // parsing just a piece of a larger pattern.
607 if (isSub === SUBPARSE) {
608 return [re, hasMagic]
611 // skip the regexp for non-magical patterns
612 // unescape anything in it, though, so that it'll be
613 // an exact match against a file etc.
615 return globUnescape(pattern)
618 var flags = options.nocase ? 'i' : ''
619 var regExp = new RegExp('^' + re + '$', flags)
621 regExp._glob = pattern
627 minimatch.makeRe = function (pattern, options) {
628 return new Minimatch(pattern, options || {}).makeRe()
631 Minimatch.prototype.makeRe = makeRe
633 if (this.regexp || this.regexp === false) return this.regexp
635 // at this point, this.set is a 2d array of partial
636 // pattern strings, or "**".
638 // It's better to use .match(). This function shouldn't
639 // be used, really, but it's pretty convenient sometimes,
640 // when you just want to work with a regex.
647 var options = this.options
649 var twoStar = options.noglobstar ? star
650 : options.dot ? twoStarDot
652 var flags = options.nocase ? 'i' : ''
654 var re = set.map(function (pattern) {
655 return pattern.map(function (p) {
656 return (p === GLOBSTAR) ? twoStar
657 : (typeof p === 'string') ? regExpEscape(p)
662 // must match entire pattern
663 // ending in a * or ** will make it less strict.
664 re = '^(?:' + re + ')$'
666 // can match anything, as long as it's not this.
667 if (this.negate) re = '^(?!' + re + ').*$'
670 this.regexp = new RegExp(re, flags)
677 minimatch.match = function (list, pattern, options) {
678 options = options || {}
679 var mm = new Minimatch(pattern, options)
680 list = list.filter(function (f) {
683 if (mm.options.nonull && !list.length) {
689 Minimatch.prototype.match = match
690 function match (f, partial) {
691 this.debug('match', f, this.pattern)
692 // short-circuit in the case of busted things.
694 if (this.comment) return false
695 if (this.empty) return f === ''
697 if (f === '/' && partial) return true
699 var options = this.options
701 // windows: need to use /, not \
702 if (path.sep !== '/') {
703 f = f.split(path.sep).join('/')
706 // treat the test path as a set of pathparts.
707 f = f.split(slashSplit)
708 this.debug(this.pattern, 'split', f)
710 // just ONE of the pattern sets in this.set needs to match
711 // in order for it to be valid. If negating, then just one
712 // match means that we have failed.
713 // Either way, return on the first hit.
716 this.debug(this.pattern, 'set', set)
718 // Find the basename of the path by looking for the last non-empty segment
721 for (i = f.length - 1; i >= 0; i--) {
726 for (i = 0; i < set.length; i++) {
729 if (options.matchBase && pattern.length === 1) {
732 var hit = this.matchOne(file, pattern, partial)
734 if (options.flipNegate) return true
739 // didn't get any hits. this is success if it's a negative
740 // pattern, failure otherwise.
741 if (options.flipNegate) return false
745 // set partial to true to test if, for example,
746 // "/a/b" matches the start of "/*/b/*/d"
747 // Partial means, if you run out of file before you run
748 // out of pattern, then that's fine, as long as all
750 Minimatch.prototype.matchOne = function (file, pattern, partial) {
751 var options = this.options
753 this.debug('matchOne',
754 { 'this': this, file: file, pattern: pattern })
756 this.debug('matchOne', file.length, pattern.length)
762 ; (fi < fl) && (pi < pl)
764 this.debug('matchOne loop')
768 this.debug(pattern, p, f)
770 // should be impossible.
771 // some invalid regexp stuff in the set.
772 if (p === false) return false
774 if (p === GLOBSTAR) {
775 this.debug('GLOBSTAR', [pattern, p, f])
778 // a/**/b/**/c would match the following:
783 // To do this, take the rest of the pattern after
784 // the **, and see if it would match the file remainder.
785 // If so, return success.
786 // If not, the ** "swallows" a segment, and try again.
787 // This is recursively awful.
789 // a/**/b/**/c matching a/b/x/y/z/c
792 // - matchOne(b/x/y/z/c, b/**/c)
795 // - matchOne(x/y/z/c, c) -> no
796 // - matchOne(y/z/c, c) -> no
797 // - matchOne(z/c, c) -> no
798 // - matchOne(c, c) yes, hit
802 this.debug('** at the end')
803 // a ** at the end will just swallow the rest.
804 // We have found a match.
805 // however, it will not swallow /.x, unless
806 // options.dot is set.
807 // . and .. are *never* matched by **, for explosively
808 // exponential reasons.
809 for (; fi < fl; fi++) {
810 if (file[fi] === '.' || file[fi] === '..' ||
811 (!options.dot && file[fi].charAt(0) === '.')) return false
816 // ok, let's see if we can swallow whatever we can.
818 var swallowee = file[fr]
820 this.debug('\nglobstar while', file, fr, pattern, pr, swallowee)
822 // XXX remove this slice. Just pass the start index.
823 if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
824 this.debug('globstar found match!', fr, fl, swallowee)
828 // can't swallow "." or ".." ever.
829 // can only swallow ".foo" when explicitly asked.
830 if (swallowee === '.' || swallowee === '..' ||
831 (!options.dot && swallowee.charAt(0) === '.')) {
832 this.debug('dot detected!', file, fr, pattern, pr)
836 // ** swallows a segment, and continue.
837 this.debug('globstar swallow a segment, and continue')
842 // no match was found.
843 // However, in partial mode, we can't say this is necessarily over.
844 // If there's more *pattern* left, then
847 this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
848 if (fr === fl) return true
853 // something other than **
854 // non-magic patterns just have to match exactly
855 // patterns with magic have been turned into regexps.
857 if (typeof p === 'string') {
858 if (options.nocase) {
859 hit = f.toLowerCase() === p.toLowerCase()
863 this.debug('string match', p, f, hit)
866 this.debug('pattern match', p, f, hit)
869 if (!hit) return false
872 // Note: ending in / means that we'll get a final ""
873 // at the end of the pattern. This can only match a
874 // corresponding "" at the end of the file.
875 // If the file ends in /, then it can only match a
876 // a pattern that ends in /, unless the pattern just
877 // doesn't have any more for it. But, a/b/ should *not*
878 // match "a/b/*", even though "" matches against the
879 // [^/]*? pattern, except in partial mode, where it might
880 // simply not be reached yet.
881 // However, a/b/ should still satisfy a/*
883 // now either we fell off the end of the pattern, or we're done.
884 if (fi === fl && pi === pl) {
885 // ran out of pattern and filename at the same time.
888 } else if (fi === fl) {
889 // ran out of file, but still had pattern left.
890 // this is ok if we're doing the match as part of
891 // a glob fs traversal.
893 } else if (pi === pl) {
894 // ran out of pattern, still have file left.
895 // this is only acceptable if we're on the very last
896 // empty segment of a file with a trailing slash.
897 // a/* should match a/b/
898 var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
902 // should be unreachable.
903 throw new Error('wtf?')
906 // replace stuff like \* with *
907 function globUnescape (s) {
908 return s.replace(/\\(.)/g, '$1')
911 function regExpEscape (s) {
912 return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
915 },{"brace-expansion":2,"path":undefined}],2:[function(require,module,exports){
916 var concatMap = require('concat-map');
917 var balanced = require('balanced-match');
919 module.exports = expandTop;
921 var escSlash = '\0SLASH'+Math.random()+'\0';
922 var escOpen = '\0OPEN'+Math.random()+'\0';
923 var escClose = '\0CLOSE'+Math.random()+'\0';
924 var escComma = '\0COMMA'+Math.random()+'\0';
925 var escPeriod = '\0PERIOD'+Math.random()+'\0';
927 function numeric(str) {
928 return parseInt(str, 10) == str
933 function escapeBraces(str) {
934 return str.split('\\\\').join(escSlash)
935 .split('\\{').join(escOpen)
936 .split('\\}').join(escClose)
937 .split('\\,').join(escComma)
938 .split('\\.').join(escPeriod);
941 function unescapeBraces(str) {
942 return str.split(escSlash).join('\\')
943 .split(escOpen).join('{')
944 .split(escClose).join('}')
945 .split(escComma).join(',')
946 .split(escPeriod).join('.');
950 // Basically just str.split(","), but handling cases
951 // where we have nested braced sections, which should be
952 // treated as individual members, like {a,{b,c},d}
953 function parseCommaParts(str) {
958 var m = balanced('{', '}', str);
961 return str.split(',');
966 var p = pre.split(',');
968 p[p.length-1] += '{' + body + '}';
969 var postParts = parseCommaParts(post);
971 p[p.length-1] += postParts.shift();
972 p.push.apply(p, postParts);
975 parts.push.apply(parts, p);
980 function expandTop(str) {
984 var expansions = expand(escapeBraces(str));
985 return expansions.filter(identity).map(unescapeBraces);
988 function identity(e) {
992 function embrace(str) {
993 return '{' + str + '}';
995 function isPadded(el) {
996 return /^-?0\d/.test(el);
1002 function gte(i, y) {
1006 function expand(str) {
1007 var expansions = [];
1009 var m = balanced('{', '}', str);
1010 if (!m || /\$$/.test(m.pre)) return [str];
1012 var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
1013 var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
1014 var isSequence = isNumericSequence || isAlphaSequence;
1015 var isOptions = /^(.*,)+(.+)?$/.test(m.body);
1016 if (!isSequence && !isOptions) {
1018 if (m.post.match(/,.*}/)) {
1019 str = m.pre + '{' + m.body + escClose + m.post;
1027 n = m.body.split(/\.\./);
1029 n = parseCommaParts(m.body);
1030 if (n.length === 1) {
1031 // x{{a,b}}y ==> x{a}y x{b}y
1032 n = expand(n[0]).map(embrace);
1033 if (n.length === 1) {
1034 var post = m.post.length
1037 return post.map(function(p) {
1038 return m.pre + n[0] + p;
1044 // at this point, n is the parts, and we know it's not a comma set
1045 // with a single entry.
1047 // no need to expand pre, since it is guaranteed to be free of brace-sets
1049 var post = m.post.length
1056 var x = numeric(n[0]);
1057 var y = numeric(n[1]);
1058 var width = Math.max(n[0].length, n[1].length)
1059 var incr = n.length == 3
1060 ? Math.abs(numeric(n[2]))
1063 var reverse = y < x;
1068 var pad = n.some(isPadded);
1072 for (var i = x; test(i, y); i += incr) {
1074 if (isAlphaSequence) {
1075 c = String.fromCharCode(i);
1081 var need = width - c.length;
1083 var z = new Array(need + 1).join('0');
1085 c = '-' + z + c.slice(1);
1094 N = concatMap(n, function(el) { return expand(el) });
1097 for (var j = 0; j < N.length; j++) {
1098 for (var k = 0; k < post.length; k++) {
1099 expansions.push([pre, N[j], post[k]].join(''))
1107 },{"balanced-match":3,"concat-map":4}],3:[function(require,module,exports){
1108 module.exports = balanced;
1109 function balanced(a, b, str) {
1114 for (var i = 0; i < str.length; i++) {
1115 if (a == str.substr(i, a.length)) {
1116 if (!('start' in m)) m.start = i;
1119 else if (b == str.substr(i, b.length) && 'start' in m) {
1124 m.pre = str.substr(0, m.start);
1125 m.body = (m.end - m.start > 1)
1126 ? str.substring(m.start + a.length, m.end)
1128 m.post = str.slice(m.end + b.length);
1134 // if we opened more than we closed, find the one we closed
1136 var start = m.start + a.length;
1137 m = balanced(a, b, str.substr(start));
1141 m.pre = str.slice(0, start) + m.pre;
1147 },{}],4:[function(require,module,exports){
1148 module.exports = function (xs, fn) {
1150 for (var i = 0; i < xs.length; i++) {
1151 var x = fn(xs[i], i);
1152 if (Array.isArray(x)) res.push.apply(res, x);