react / wstein / node_modules / browserify / node_modules / glob / node_modules / minimatch / browser.js
80538 views(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){1module.exports = minimatch2minimatch.Minimatch = Minimatch34var path = { sep: '/' }5try {6path = require('path')7} catch (er) {}89var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}10var expand = require('brace-expansion')1112// any single thing other than /13// don't need to escape / when using new RegExp()14var qmark = '[^/]'1516// * => any number of characters17var star = qmark + '*?'1819// ** when dots are allowed. Anything goes, except .. and .20// not (^ or / followed by one or two dots followed by $ or /),21// followed by anything, any number of times.22var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'2324// not a ^ or / followed by a dot,25// followed by anything, any number of times.26var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'2728// characters that need to be escaped in RegExp.29var reSpecials = charSet('().*{}+?[]^$\\!')3031// "abc" -> { a:true, b:true, c:true }32function charSet (s) {33return s.split('').reduce(function (set, c) {34set[c] = true35return set36}, {})37}3839// normalizes slashes.40var slashSplit = /\/+/4142minimatch.filter = filter43function filter (pattern, options) {44options = options || {}45return function (p, i, list) {46return minimatch(p, pattern, options)47}48}4950function ext (a, b) {51a = a || {}52b = b || {}53var t = {}54Object.keys(b).forEach(function (k) {55t[k] = b[k]56})57Object.keys(a).forEach(function (k) {58t[k] = a[k]59})60return t61}6263minimatch.defaults = function (def) {64if (!def || !Object.keys(def).length) return minimatch6566var orig = minimatch6768var m = function minimatch (p, pattern, options) {69return orig.minimatch(p, pattern, ext(def, options))70}7172m.Minimatch = function Minimatch (pattern, options) {73return new orig.Minimatch(pattern, ext(def, options))74}7576return m77}7879Minimatch.defaults = function (def) {80if (!def || !Object.keys(def).length) return Minimatch81return minimatch.defaults(def).Minimatch82}8384function minimatch (p, pattern, options) {85if (typeof pattern !== 'string') {86throw new TypeError('glob pattern string required')87}8889if (!options) options = {}9091// shortcut: comments match nothing.92if (!options.nocomment && pattern.charAt(0) === '#') {93return false94}9596// "" only matches ""97if (pattern.trim() === '') return p === ''9899return new Minimatch(pattern, options).match(p)100}101102function Minimatch (pattern, options) {103if (!(this instanceof Minimatch)) {104return new Minimatch(pattern, options)105}106107if (typeof pattern !== 'string') {108throw new TypeError('glob pattern string required')109}110111if (!options) options = {}112pattern = pattern.trim()113114// windows support: need to use /, not \115if (path.sep !== '/') {116pattern = pattern.split(path.sep).join('/')117}118119this.options = options120this.set = []121this.pattern = pattern122this.regexp = null123this.negate = false124this.comment = false125this.empty = false126127// make the set of regexps etc.128this.make()129}130131Minimatch.prototype.debug = function () {}132133Minimatch.prototype.make = make134function make () {135// don't do it more than once.136if (this._made) return137138var pattern = this.pattern139var options = this.options140141// empty patterns and comments match nothing.142if (!options.nocomment && pattern.charAt(0) === '#') {143this.comment = true144return145}146if (!pattern) {147this.empty = true148return149}150151// step 1: figure out negation, etc.152this.parseNegate()153154// step 2: expand braces155var set = this.globSet = this.braceExpand()156157if (options.debug) this.debug = console.error158159this.debug(this.pattern, set)160161// step 3: now we have a set, so turn each one into a series of path-portion162// matching patterns.163// These will be regexps, except in the case of "**", which is164// set to the GLOBSTAR object for globstar behavior,165// and will not contain any / characters166set = this.globParts = set.map(function (s) {167return s.split(slashSplit)168})169170this.debug(this.pattern, set)171172// glob --> regexps173set = set.map(function (s, si, set) {174return s.map(this.parse, this)175}, this)176177this.debug(this.pattern, set)178179// filter out everything that didn't compile properly.180set = set.filter(function (s) {181return s.indexOf(false) === -1182})183184this.debug(this.pattern, set)185186this.set = set187}188189Minimatch.prototype.parseNegate = parseNegate190function parseNegate () {191var pattern = this.pattern192var negate = false193var options = this.options194var negateOffset = 0195196if (options.nonegate) return197198for (var i = 0, l = pattern.length199; i < l && pattern.charAt(i) === '!'200; i++) {201negate = !negate202negateOffset++203}204205if (negateOffset) this.pattern = pattern.substr(negateOffset)206this.negate = negate207}208209// Brace expansion:210// a{b,c}d -> abd acd211// a{b,}c -> abc ac212// a{0..3}d -> a0d a1d a2d a3d213// a{b,c{d,e}f}g -> abg acdfg acefg214// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg215//216// Invalid sets are not expanded.217// a{2..}b -> a{2..}b218// a{b}c -> a{b}c219minimatch.braceExpand = function (pattern, options) {220return braceExpand(pattern, options)221}222223Minimatch.prototype.braceExpand = braceExpand224225function braceExpand (pattern, options) {226if (!options) {227if (this instanceof Minimatch) {228options = this.options229} else {230options = {}231}232}233234pattern = typeof pattern === 'undefined'235? this.pattern : pattern236237if (typeof pattern === 'undefined') {238throw new Error('undefined pattern')239}240241if (options.nobrace ||242!pattern.match(/\{.*\}/)) {243// shortcut. no need to expand.244return [pattern]245}246247return expand(pattern)248}249250// parse a component of the expanded set.251// At this point, no pattern may contain "/" in it252// so we're going to return a 2d array, where each entry is the full253// pattern, split on '/', and then turned into a regular expression.254// A regexp is made at the end which joins each array with an255// escaped /, and another full one which joins each regexp with |.256//257// Following the lead of Bash 4.1, note that "**" only has special meaning258// when it is the *only* thing in a path portion. Otherwise, any series259// of * is equivalent to a single *. Globstar behavior is enabled by260// default, and can be disabled by setting options.noglobstar.261Minimatch.prototype.parse = parse262var SUBPARSE = {}263function parse (pattern, isSub) {264var options = this.options265266// shortcuts267if (!options.noglobstar && pattern === '**') return GLOBSTAR268if (pattern === '') return ''269270var re = ''271var hasMagic = !!options.nocase272var escaping = false273// ? => one single character274var patternListStack = []275var plType276var stateChar277var inClass = false278var reClassStart = -1279var classStart = -1280// . and .. never match anything that doesn't start with .,281// even when options.dot is set.282var patternStart = pattern.charAt(0) === '.' ? '' // anything283// not (start or / followed by . or .. followed by / or end)284: options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'285: '(?!\\.)'286var self = this287288function clearStateChar () {289if (stateChar) {290// we had some state-tracking character291// that wasn't consumed by this pass.292switch (stateChar) {293case '*':294re += star295hasMagic = true296break297case '?':298re += qmark299hasMagic = true300break301default:302re += '\\' + stateChar303break304}305self.debug('clearStateChar %j %j', stateChar, re)306stateChar = false307}308}309310for (var i = 0, len = pattern.length, c311; (i < len) && (c = pattern.charAt(i))312; i++) {313this.debug('%s\t%s %s %j', pattern, i, re, c)314315// skip over any that are escaped.316if (escaping && reSpecials[c]) {317re += '\\' + c318escaping = false319continue320}321322switch (c) {323case '/':324// completely not allowed, even escaped.325// Should already be path-split by now.326return false327328case '\\':329clearStateChar()330escaping = true331continue332333// the various stateChar values334// for the "extglob" stuff.335case '?':336case '*':337case '+':338case '@':339case '!':340this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)341342// all of those are literals inside a class, except that343// the glob [!a] means [^a] in regexp344if (inClass) {345this.debug(' in class')346if (c === '!' && i === classStart + 1) c = '^'347re += c348continue349}350351// if we already have a stateChar, then it means352// that there was something like ** or +? in there.353// Handle the stateChar, then proceed with this one.354self.debug('call clearStateChar %j', stateChar)355clearStateChar()356stateChar = c357// if extglob is disabled, then +(asdf|foo) isn't a thing.358// just clear the statechar *now*, rather than even diving into359// the patternList stuff.360if (options.noext) clearStateChar()361continue362363case '(':364if (inClass) {365re += '('366continue367}368369if (!stateChar) {370re += '\\('371continue372}373374plType = stateChar375patternListStack.push({ type: plType, start: i - 1, reStart: re.length })376// negation is (?:(?!js)[^/]*)377re += stateChar === '!' ? '(?:(?!' : '(?:'378this.debug('plType %j %j', stateChar, re)379stateChar = false380continue381382case ')':383if (inClass || !patternListStack.length) {384re += '\\)'385continue386}387388clearStateChar()389hasMagic = true390re += ')'391plType = patternListStack.pop().type392// negation is (?:(?!js)[^/]*)393// The others are (?:<pattern>)<type>394switch (plType) {395case '!':396re += '[^/]*?)'397break398case '?':399case '+':400case '*':401re += plType402break403case '@': break // the default anyway404}405continue406407case '|':408if (inClass || !patternListStack.length || escaping) {409re += '\\|'410escaping = false411continue412}413414clearStateChar()415re += '|'416continue417418// these are mostly the same in regexp and glob419case '[':420// swallow any state-tracking char before the [421clearStateChar()422423if (inClass) {424re += '\\' + c425continue426}427428inClass = true429classStart = i430reClassStart = re.length431re += c432continue433434case ']':435// a right bracket shall lose its special436// meaning and represent itself in437// a bracket expression if it occurs438// first in the list. -- POSIX.2 2.8.3.2439if (i === classStart + 1 || !inClass) {440re += '\\' + c441escaping = false442continue443}444445// handle the case where we left a class open.446// "[z-a]" is valid, equivalent to "\[z-a\]"447if (inClass) {448// split where the last [ was, make sure we don't have449// an invalid re. if so, re-walk the contents of the450// would-be class to re-translate any characters that451// were passed through as-is452// TODO: It would probably be faster to determine this453// without a try/catch and a new RegExp, but it's tricky454// to do safely. For now, this is safe and works.455var cs = pattern.substring(classStart + 1, i)456try {457RegExp('[' + cs + ']')458} catch (er) {459// not a valid class!460var sp = this.parse(cs, SUBPARSE)461re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'462hasMagic = hasMagic || sp[1]463inClass = false464continue465}466}467468// finish up the class.469hasMagic = true470inClass = false471re += c472continue473474default:475// swallow any state char that wasn't consumed476clearStateChar()477478if (escaping) {479// no need480escaping = false481} else if (reSpecials[c]482&& !(c === '^' && inClass)) {483re += '\\'484}485486re += c487488} // switch489} // for490491// handle the case where we left a class open.492// "[abc" is valid, equivalent to "\[abc"493if (inClass) {494// split where the last [ was, and escape it495// this is a huge pita. We now have to re-walk496// the contents of the would-be class to re-translate497// any characters that were passed through as-is498cs = pattern.substr(classStart + 1)499sp = this.parse(cs, SUBPARSE)500re = re.substr(0, reClassStart) + '\\[' + sp[0]501hasMagic = hasMagic || sp[1]502}503504// handle the case where we had a +( thing at the *end*505// of the pattern.506// each pattern list stack adds 3 chars, and we need to go through507// and escape any | chars that were passed through as-is for the regexp.508// Go through and escape them, taking care not to double-escape any509// | chars that were already escaped.510for (var pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {511var tail = re.slice(pl.reStart + 3)512// maybe some even number of \, then maybe 1 \, followed by a |513tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) {514if (!$2) {515// the | isn't already escaped, so escape it.516$2 = '\\'517}518519// need to escape all those slashes *again*, without escaping the520// one that we need for escaping the | character. As it works out,521// escaping an even number of slashes can be done by simply repeating522// it exactly after itself. That's why this trick works.523//524// I am sorry that you have to see this.525return $1 + $1 + $2 + '|'526})527528this.debug('tail=%j\n %s', tail, tail)529var t = pl.type === '*' ? star530: pl.type === '?' ? qmark531: '\\' + pl.type532533hasMagic = true534re = re.slice(0, pl.reStart) + t + '\\(' + tail535}536537// handle trailing things that only matter at the very end.538clearStateChar()539if (escaping) {540// trailing \\541re += '\\\\'542}543544// only need to apply the nodot start if the re starts with545// something that could conceivably capture a dot546var addPatternStart = false547switch (re.charAt(0)) {548case '.':549case '[':550case '(': addPatternStart = true551}552553// if the re is not "" at this point, then we need to make sure554// it doesn't match against an empty path part.555// Otherwise a/* will match a/, which it should not.556if (re !== '' && hasMagic) re = '(?=.)' + re557558if (addPatternStart) re = patternStart + re559560// parsing just a piece of a larger pattern.561if (isSub === SUBPARSE) {562return [re, hasMagic]563}564565// skip the regexp for non-magical patterns566// unescape anything in it, though, so that it'll be567// an exact match against a file etc.568if (!hasMagic) {569return globUnescape(pattern)570}571572var flags = options.nocase ? 'i' : ''573var regExp = new RegExp('^' + re + '$', flags)574575regExp._glob = pattern576regExp._src = re577578return regExp579}580581minimatch.makeRe = function (pattern, options) {582return new Minimatch(pattern, options || {}).makeRe()583}584585Minimatch.prototype.makeRe = makeRe586function makeRe () {587if (this.regexp || this.regexp === false) return this.regexp588589// at this point, this.set is a 2d array of partial590// pattern strings, or "**".591//592// It's better to use .match(). This function shouldn't593// be used, really, but it's pretty convenient sometimes,594// when you just want to work with a regex.595var set = this.set596597if (!set.length) {598this.regexp = false599return this.regexp600}601var options = this.options602603var twoStar = options.noglobstar ? star604: options.dot ? twoStarDot605: twoStarNoDot606var flags = options.nocase ? 'i' : ''607608var re = set.map(function (pattern) {609return pattern.map(function (p) {610return (p === GLOBSTAR) ? twoStar611: (typeof p === 'string') ? regExpEscape(p)612: p._src613}).join('\\\/')614}).join('|')615616// must match entire pattern617// ending in a * or ** will make it less strict.618re = '^(?:' + re + ')$'619620// can match anything, as long as it's not this.621if (this.negate) re = '^(?!' + re + ').*$'622623try {624this.regexp = new RegExp(re, flags)625} catch (ex) {626this.regexp = false627}628return this.regexp629}630631minimatch.match = function (list, pattern, options) {632options = options || {}633var mm = new Minimatch(pattern, options)634list = list.filter(function (f) {635return mm.match(f)636})637if (mm.options.nonull && !list.length) {638list.push(pattern)639}640return list641}642643Minimatch.prototype.match = match644function match (f, partial) {645this.debug('match', f, this.pattern)646// short-circuit in the case of busted things.647// comments, etc.648if (this.comment) return false649if (this.empty) return f === ''650651if (f === '/' && partial) return true652653var options = this.options654655// windows: need to use /, not \656if (path.sep !== '/') {657f = f.split(path.sep).join('/')658}659660// treat the test path as a set of pathparts.661f = f.split(slashSplit)662this.debug(this.pattern, 'split', f)663664// just ONE of the pattern sets in this.set needs to match665// in order for it to be valid. If negating, then just one666// match means that we have failed.667// Either way, return on the first hit.668669var set = this.set670this.debug(this.pattern, 'set', set)671672// Find the basename of the path by looking for the last non-empty segment673var filename674var i675for (i = f.length - 1; i >= 0; i--) {676filename = f[i]677if (filename) break678}679680for (i = 0; i < set.length; i++) {681var pattern = set[i]682var file = f683if (options.matchBase && pattern.length === 1) {684file = [filename]685}686var hit = this.matchOne(file, pattern, partial)687if (hit) {688if (options.flipNegate) return true689return !this.negate690}691}692693// didn't get any hits. this is success if it's a negative694// pattern, failure otherwise.695if (options.flipNegate) return false696return this.negate697}698699// set partial to true to test if, for example,700// "/a/b" matches the start of "/*/b/*/d"701// Partial means, if you run out of file before you run702// out of pattern, then that's fine, as long as all703// the parts match.704Minimatch.prototype.matchOne = function (file, pattern, partial) {705var options = this.options706707this.debug('matchOne',708{ 'this': this, file: file, pattern: pattern })709710this.debug('matchOne', file.length, pattern.length)711712for (var fi = 0,713pi = 0,714fl = file.length,715pl = pattern.length716; (fi < fl) && (pi < pl)717; fi++, pi++) {718this.debug('matchOne loop')719var p = pattern[pi]720var f = file[fi]721722this.debug(pattern, p, f)723724// should be impossible.725// some invalid regexp stuff in the set.726if (p === false) return false727728if (p === GLOBSTAR) {729this.debug('GLOBSTAR', [pattern, p, f])730731// "**"732// a/**/b/**/c would match the following:733// a/b/x/y/z/c734// a/x/y/z/b/c735// a/b/x/b/x/c736// a/b/c737// To do this, take the rest of the pattern after738// the **, and see if it would match the file remainder.739// If so, return success.740// If not, the ** "swallows" a segment, and try again.741// This is recursively awful.742//743// a/**/b/**/c matching a/b/x/y/z/c744// - a matches a745// - doublestar746// - matchOne(b/x/y/z/c, b/**/c)747// - b matches b748// - doublestar749// - matchOne(x/y/z/c, c) -> no750// - matchOne(y/z/c, c) -> no751// - matchOne(z/c, c) -> no752// - matchOne(c, c) yes, hit753var fr = fi754var pr = pi + 1755if (pr === pl) {756this.debug('** at the end')757// a ** at the end will just swallow the rest.758// We have found a match.759// however, it will not swallow /.x, unless760// options.dot is set.761// . and .. are *never* matched by **, for explosively762// exponential reasons.763for (; fi < fl; fi++) {764if (file[fi] === '.' || file[fi] === '..' ||765(!options.dot && file[fi].charAt(0) === '.')) return false766}767return true768}769770// ok, let's see if we can swallow whatever we can.771while (fr < fl) {772var swallowee = file[fr]773774this.debug('\nglobstar while', file, fr, pattern, pr, swallowee)775776// XXX remove this slice. Just pass the start index.777if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {778this.debug('globstar found match!', fr, fl, swallowee)779// found a match.780return true781} else {782// can't swallow "." or ".." ever.783// can only swallow ".foo" when explicitly asked.784if (swallowee === '.' || swallowee === '..' ||785(!options.dot && swallowee.charAt(0) === '.')) {786this.debug('dot detected!', file, fr, pattern, pr)787break788}789790// ** swallows a segment, and continue.791this.debug('globstar swallow a segment, and continue')792fr++793}794}795796// no match was found.797// However, in partial mode, we can't say this is necessarily over.798// If there's more *pattern* left, then799if (partial) {800// ran out of file801this.debug('\n>>> no match, partial?', file, fr, pattern, pr)802if (fr === fl) return true803}804return false805}806807// something other than **808// non-magic patterns just have to match exactly809// patterns with magic have been turned into regexps.810var hit811if (typeof p === 'string') {812if (options.nocase) {813hit = f.toLowerCase() === p.toLowerCase()814} else {815hit = f === p816}817this.debug('string match', p, f, hit)818} else {819hit = f.match(p)820this.debug('pattern match', p, f, hit)821}822823if (!hit) return false824}825826// Note: ending in / means that we'll get a final ""827// at the end of the pattern. This can only match a828// corresponding "" at the end of the file.829// If the file ends in /, then it can only match a830// a pattern that ends in /, unless the pattern just831// doesn't have any more for it. But, a/b/ should *not*832// match "a/b/*", even though "" matches against the833// [^/]*? pattern, except in partial mode, where it might834// simply not be reached yet.835// However, a/b/ should still satisfy a/*836837// now either we fell off the end of the pattern, or we're done.838if (fi === fl && pi === pl) {839// ran out of pattern and filename at the same time.840// an exact hit!841return true842} else if (fi === fl) {843// ran out of file, but still had pattern left.844// this is ok if we're doing the match as part of845// a glob fs traversal.846return partial847} else if (pi === pl) {848// ran out of pattern, still have file left.849// this is only acceptable if we're on the very last850// empty segment of a file with a trailing slash.851// a/* should match a/b/852var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')853return emptyFileEnd854}855856// should be unreachable.857throw new Error('wtf?')858}859860// replace stuff like \* with *861function globUnescape (s) {862return s.replace(/\\(.)/g, '$1')863}864865function regExpEscape (s) {866return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')867}868869},{"brace-expansion":2,"path":undefined}],2:[function(require,module,exports){870var concatMap = require('concat-map');871var balanced = require('balanced-match');872873module.exports = expandTop;874875var escSlash = '\0SLASH'+Math.random()+'\0';876var escOpen = '\0OPEN'+Math.random()+'\0';877var escClose = '\0CLOSE'+Math.random()+'\0';878var escComma = '\0COMMA'+Math.random()+'\0';879var escPeriod = '\0PERIOD'+Math.random()+'\0';880881function numeric(str) {882return parseInt(str, 10) == str883? parseInt(str, 10)884: str.charCodeAt(0);885}886887function escapeBraces(str) {888return str.split('\\\\').join(escSlash)889.split('\\{').join(escOpen)890.split('\\}').join(escClose)891.split('\\,').join(escComma)892.split('\\.').join(escPeriod);893}894895function unescapeBraces(str) {896return str.split(escSlash).join('\\')897.split(escOpen).join('{')898.split(escClose).join('}')899.split(escComma).join(',')900.split(escPeriod).join('.');901}902903904// Basically just str.split(","), but handling cases905// where we have nested braced sections, which should be906// treated as individual members, like {a,{b,c},d}907function parseCommaParts(str) {908if (!str)909return [''];910911var parts = [];912var m = balanced('{', '}', str);913914if (!m)915return str.split(',');916917var pre = m.pre;918var body = m.body;919var post = m.post;920var p = pre.split(',');921922p[p.length-1] += '{' + body + '}';923var postParts = parseCommaParts(post);924if (post.length) {925p[p.length-1] += postParts.shift();926p.push.apply(p, postParts);927}928929parts.push.apply(parts, p);930931return parts;932}933934function expandTop(str) {935if (!str)936return [];937938var expansions = expand(escapeBraces(str));939return expansions.filter(identity).map(unescapeBraces);940}941942function identity(e) {943return e;944}945946function embrace(str) {947return '{' + str + '}';948}949function isPadded(el) {950return /^-?0\d/.test(el);951}952953function lte(i, y) {954return i <= y;955}956function gte(i, y) {957return i >= y;958}959960function expand(str) {961var expansions = [];962963var m = balanced('{', '}', str);964if (!m || /\$$/.test(m.pre)) return [str];965966var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);967var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);968var isSequence = isNumericSequence || isAlphaSequence;969var isOptions = /^(.*,)+(.+)?$/.test(m.body);970if (!isSequence && !isOptions) {971// {a},b}972if (m.post.match(/,.*}/)) {973str = m.pre + '{' + m.body + escClose + m.post;974return expand(str);975}976return [str];977}978979var n;980if (isSequence) {981n = m.body.split(/\.\./);982} else {983n = parseCommaParts(m.body);984if (n.length === 1) {985// x{{a,b}}y ==> x{a}y x{b}y986n = expand(n[0]).map(embrace);987if (n.length === 1) {988var post = m.post.length989? expand(m.post)990: [''];991return post.map(function(p) {992return m.pre + n[0] + p;993});994}995}996}997998// at this point, n is the parts, and we know it's not a comma set999// with a single entry.10001001// no need to expand pre, since it is guaranteed to be free of brace-sets1002var pre = m.pre;1003var post = m.post.length1004? expand(m.post)1005: [''];10061007var N;10081009if (isSequence) {1010var x = numeric(n[0]);1011var y = numeric(n[1]);1012var width = Math.max(n[0].length, n[1].length)1013var incr = n.length == 31014? Math.abs(numeric(n[2]))1015: 1;1016var test = lte;1017var reverse = y < x;1018if (reverse) {1019incr *= -1;1020test = gte;1021}1022var pad = n.some(isPadded);10231024N = [];10251026for (var i = x; test(i, y); i += incr) {1027var c;1028if (isAlphaSequence) {1029c = String.fromCharCode(i);1030if (c === '\\')1031c = '';1032} else {1033c = String(i);1034if (pad) {1035var need = width - c.length;1036if (need > 0) {1037var z = new Array(need + 1).join('0');1038if (i < 0)1039c = '-' + z + c.slice(1);1040else1041c = z + c;1042}1043}1044}1045N.push(c);1046}1047} else {1048N = concatMap(n, function(el) { return expand(el) });1049}10501051for (var j = 0; j < N.length; j++) {1052for (var k = 0; k < post.length; k++) {1053expansions.push([pre, N[j], post[k]].join(''))1054}1055}10561057return expansions;1058}105910601061},{"balanced-match":3,"concat-map":4}],3:[function(require,module,exports){1062module.exports = balanced;1063function balanced(a, b, str) {1064var bal = 0;1065var m = {};1066var ended = false;10671068for (var i = 0; i < str.length; i++) {1069if (a == str.substr(i, a.length)) {1070if (!('start' in m)) m.start = i;1071bal++;1072}1073else if (b == str.substr(i, b.length) && 'start' in m) {1074ended = true;1075bal--;1076if (!bal) {1077m.end = i;1078m.pre = str.substr(0, m.start);1079m.body = (m.end - m.start > 1)1080? str.substring(m.start + a.length, m.end)1081: '';1082m.post = str.slice(m.end + b.length);1083return m;1084}1085}1086}10871088// if we opened more than we closed, find the one we closed1089if (bal && ended) {1090var start = m.start + a.length;1091m = balanced(a, b, str.substr(start));1092if (m) {1093m.start += start;1094m.end += start;1095m.pre = str.slice(0, start) + m.pre;1096}1097return m;1098}1099}11001101},{}],4:[function(require,module,exports){1102module.exports = function (xs, fn) {1103var res = [];1104for (var i = 0; i < xs.length; i++) {1105var x = fn(xs[i], i);1106if (Array.isArray(x)) res.push.apply(res, x);1107else res.push(x);1108}1109return res;1110};11111112},{}]},{},[1]);111311141115