diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2015-01-16 09:55:39 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2015-01-16 09:55:39 +0300 |
commit | 6338bcfcd9cd1b0cc48b051dae764dc436ab5332 (patch) | |
tree | 5ad1f243576e00153f941da563c0ca74c2b78817 /node_modules/glob | |
parent | 5fce278a688a1cb79183e012bde40b089c2e97a4 (diff) |
glob@4.3.5
Change to single quotes everywhere for some reason.
Diffstat (limited to 'node_modules/glob')
-rw-r--r-- | node_modules/glob/README.md | 4 | ||||
-rw-r--r-- | node_modules/glob/glob.js | 123 | ||||
-rw-r--r-- | node_modules/glob/package.json | 23 | ||||
-rw-r--r-- | node_modules/glob/sync.js | 73 |
4 files changed, 110 insertions, 113 deletions
diff --git a/node_modules/glob/README.md b/node_modules/glob/README.md index d72bdccbe..e479ae29e 100644 --- a/node_modules/glob/README.md +++ b/node_modules/glob/README.md @@ -249,10 +249,6 @@ filesystem. flag to disable that behavior. * `nonull` Set to never return an empty set, instead returning a set containing the pattern itself. This is the default in glob(3). -* `nocase` Perform a case-insensitive match. Note that - case-insensitive filesystems will sometimes result in glob returning - results that are case-insensitively matched anyway, since readdir - and stat will not raise an error. * `debug` Set to enable debug logging in minimatch and glob. * `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. * `noglobstar` Do not match `**` against multiple filenames. (Ie, diff --git a/node_modules/glob/glob.js b/node_modules/glob/glob.js index 8c9907821..7401e0b7e 100644 --- a/node_modules/glob/glob.js +++ b/node_modules/glob/glob.js @@ -40,26 +40,27 @@ module.exports = glob -var fs = require("fs") -var minimatch = require("minimatch") +var fs = require('fs') +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 globSync = require("./sync.js") -var common = require("./common.js") +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var globSync = require('./sync.js') +var common = require('./common.js') var alphasort = common.alphasort +var alphasorti = common.alphasorti var isAbsolute = common.isAbsolute var setopts = common.setopts var ownProp = common.ownProp -var inflight = require("inflight") -var util = require("util") +var inflight = require('inflight') +var util = require('util') -var once = require("once") +var once = require('once') function glob (pattern, options, cb) { - if (typeof options === "function") cb = options, options = {} + if (typeof options === 'function') cb = options, options = {} if (!options) options = {} if (options.sync) { @@ -97,7 +98,7 @@ glob.hasMagic = function (pattern, options_) { glob.Glob = Glob inherits(Glob, EE) function Glob (pattern, options, cb) { - if (typeof options === "function") { + if (typeof options === 'function') { cb = options options = null } @@ -122,10 +123,10 @@ function Glob (pattern, options, cb) { // Keep them as a list so we can fill in when nonull is set. this.matches = new Array(n) - if (typeof cb === "function") { + if (typeof cb === 'function') { cb = once(cb) - this.on("error", cb) - this.on("end", function (matches) { + this.on('error', cb) + this.on('end', function (matches) { cb(null, matches) }) } @@ -163,7 +164,7 @@ Glob.prototype._finish = function () { //console.error('FINISH', this.matches) common.finish(this) - this.emit("end", this.found) + this.emit('end', this.found) } Glob.prototype._mark = function (p) { @@ -176,19 +177,19 @@ Glob.prototype._makeAbs = function (f) { Glob.prototype.abort = function () { this.aborted = true - this.emit("abort") + this.emit('abort') } Glob.prototype.pause = function () { if (!this.paused) { this.paused = true - this.emit("pause") + this.emit('pause') } } Glob.prototype.resume = function () { if (this.paused) { - this.emit("resume") + this.emit('resume') this.paused = false if (this._emitQueue.length) { var eq = this._emitQueue.slice(0) @@ -223,11 +224,11 @@ Glob.prototype._process = function (pattern, index, inGlobStar, cb) { return } - //console.error("PROCESS %d", this._processing, pattern) + //console.error('PROCESS %d', this._processing, pattern) // Get the first [n] parts of pattern that are all strings. var n = 0 - while (typeof pattern[n] === "string") { + while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. @@ -248,9 +249,9 @@ Glob.prototype._process = function (pattern, index, inGlobStar, cb) { default: // pattern has some string bits in the front. - // whatever it starts with, whether that's "absolute" like /foo/bar, - // or "relative" like "../baz" - prefix = pattern.slice(0, n).join("/") + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') break } @@ -259,10 +260,10 @@ Glob.prototype._process = function (pattern, index, inGlobStar, cb) { // get the list of entries. var read if (prefix === null) - read = "." - else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) - prefix = "/" + prefix + prefix = '/' + prefix read = prefix } else read = prefix @@ -295,12 +296,12 @@ Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, in var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === "." + 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) { + if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) @@ -331,13 +332,13 @@ Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, in for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { - if (prefix !== "/") - e = prefix + "/" + e + if (prefix !== '/') + e = prefix + '/' + e else e = prefix + e } - if (e.charAt(0) === "/" && !this.nomount) { + if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) @@ -353,8 +354,8 @@ Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, in var e = matchedEntries[i] var newPattern if (prefix) { - if (prefix !== "/") - e = prefix + "/" + e + if (prefix !== '/') + e = prefix + '/' + e else e = prefix + e } @@ -381,12 +382,12 @@ Glob.prototype._emitMatch = function (index, e) { this.matches[index][e] = true if (!this.stat && !this.mark) - return this.emit("match", e) + return this.emit('match', e) var self = this this._stat(this._makeAbs(e), function (er, c, st) { - self.emit("stat", e, st) - self.emit("match", e) + self.emit('stat', e, st) + self.emit('match', e) }) } } @@ -395,7 +396,7 @@ Glob.prototype._readdirInGlobStar = function (abs, cb) { if (this.aborted) return - var lstatkey = "lstat\0" + abs + var lstatkey = 'lstat\0' + abs var self = this var lstatcb = inflight(lstatkey, lstatcb_) @@ -423,11 +424,11 @@ Glob.prototype._readdir = function (abs, inGlobStar, cb) { if (this.aborted) return - cb = inflight("readdir\0"+abs+"\0"+inGlobStar, cb) + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) if (!cb) return - //console.error("RD %j %j", +inGlobStar, abs) + //console.error('RD %j %j', +inGlobStar, abs) if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs, cb) @@ -449,7 +450,7 @@ function readdirCb (self, abs, cb) { if (er) self._readdirError(abs, er, cb) else - self._readdirEntries(abs, entries.sort(alphasort), cb) + self._readdirEntries(abs, entries, cb) } } @@ -463,10 +464,10 @@ Glob.prototype._readdirEntries = function (abs, entries, cb) { if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] - if (abs === "/") + if (abs === '/') e = abs + e else - e = abs + "/" + e + e = abs + '/' + e this.cache[e] = true } } @@ -481,21 +482,21 @@ Glob.prototype._readdirError = function (f, er, cb) { // handle errors, and cache the information switch (er.code) { - case "ENOTDIR": // totally normal. means it *does* exist. + case 'ENOTDIR': // totally normal. means it *does* exist. this.cache[f] = 'FILE' break - case "ENOENT": // not terribly unusual - case "ELOOP": - case "ENAMETOOLONG": - case "UNKNOWN": + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': this.cache[f] = false break default: // some unusual error. Treat as failure. this.cache[f] = false - if (this.strict) return this.emit("error", er) - if (!this.silent) console.error("glob error", er) + if (this.strict) return this.emit('error', er) + if (!this.silent) console.error('glob error', er) break } return cb() @@ -510,7 +511,7 @@ Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, in Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error("pgs2", prefix, remain[0], entries) + //console.error('pgs2', prefix, remain[0], entries) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt @@ -535,7 +536,7 @@ Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, i for (var i = 0; i < len; i++) { var e = entries[i] - if (e.charAt(0) === "." && !this.dot) + if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state @@ -559,7 +560,7 @@ Glob.prototype._processSimple = function (prefix, index, cb) { } Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - //console.error("ps2", prefix, exists) + //console.error('ps2', prefix, exists) if (!this.matches[index]) this.matches[index] = Object.create(null) @@ -570,7 +571,7 @@ Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === "/") { + if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) @@ -579,8 +580,8 @@ Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { } } - if (process.platform === "win32") - prefix = prefix.replace(/\\/g, "/") + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) @@ -590,7 +591,7 @@ Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { // Returns either 'DIR', 'FILE', or false Glob.prototype._stat = function (f, cb) { var abs = f - if (f.charAt(0) === "/") + if (f.charAt(0) === '/') abs = path.join(this.root, f) else if (this.changedCwd) abs = path.resolve(this.cwd, f) @@ -606,7 +607,7 @@ Glob.prototype._stat = function (f, cb) { c = 'DIR' // It exists, but not how we need it - if (abs.slice(-1) === "/" && c !== 'DIR') + if (abs.slice(-1) === '/' && c !== 'DIR') return cb() return cb(null, c) @@ -622,7 +623,7 @@ Glob.prototype._stat = function (f, cb) { } var self = this - var statcb = inflight("stat\0" + abs, statcb_) + var statcb = inflight('stat\0' + abs, statcb_) if (statcb) fs.stat(abs, statcb) @@ -639,7 +640,7 @@ Glob.prototype._stat2 = function (f, abs, er, stat, cb) { this.statCache[abs] = stat - if (abs.slice(-1) === "/" && !stat.isDirectory()) + if (abs.slice(-1) === '/' && !stat.isDirectory()) return cb(null, false, stat) var c = stat.isDirectory() ? 'DIR' : 'FILE' diff --git a/node_modules/glob/package.json b/node_modules/glob/package.json index 214a26045..5b782d625 100644 --- a/node_modules/glob/package.json +++ b/node_modules/glob/package.json @@ -6,7 +6,7 @@ }, "name": "glob", "description": "a little globber", - "version": "4.3.2", + "version": "4.3.5", "repository": { "type": "git", "url": "git://github.com/isaacs/node-glob.git" @@ -29,7 +29,7 @@ "devDependencies": { "mkdirp": "0", "rimraf": "^2.2.8", - "tap": "~0.4.0", + "tap": "^0.5.0", "tick": "0.0.6" }, "scripts": { @@ -42,16 +42,16 @@ "benchclean": "bash benchclean.sh" }, "license": "ISC", - "gitHead": "941d53c8ab6216f43a6f5e8e01245364ba90cfe9", + "gitHead": "9de4cb6bfeb9c8458cf188fe91447b99bf8f3cfd", "bugs": { "url": "https://github.com/isaacs/node-glob/issues" }, "homepage": "https://github.com/isaacs/node-glob", - "_id": "glob@4.3.2", - "_shasum": "351ec7dafc29256b253ad86cd6b48c5a3404b76d", - "_from": "glob@>=4.3.2 <4.4.0", - "_npmVersion": "2.1.14", - "_nodeVersion": "0.10.33", + "_id": "glob@4.3.5", + "_shasum": "80fbb08ca540f238acce5d11d1e9bc41e75173d3", + "_from": "glob@>=4.3.5 <4.4.0", + "_npmVersion": "2.2.0", + "_nodeVersion": "0.10.35", "_npmUser": { "name": "isaacs", "email": "i@izs.me" @@ -63,10 +63,9 @@ } ], "dist": { - "shasum": "351ec7dafc29256b253ad86cd6b48c5a3404b76d", - "tarball": "http://registry.npmjs.org/glob/-/glob-4.3.2.tgz" + "shasum": "80fbb08ca540f238acce5d11d1e9bc41e75173d3", + "tarball": "http://registry.npmjs.org/glob/-/glob-4.3.5.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/glob/-/glob-4.3.2.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz" } diff --git a/node_modules/glob/sync.js b/node_modules/glob/sync.js index a7f9f52da..f981055af 100644 --- a/node_modules/glob/sync.js +++ b/node_modules/glob/sync.js @@ -1,15 +1,16 @@ module.exports = globSync globSync.GlobSync = GlobSync -var fs = require("fs") -var minimatch = require("minimatch") +var fs = require('fs') +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 common = require("./common.js") +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var common = require('./common.js') var alphasort = common.alphasort +var alphasorti = common.alphasorti var isAbsolute = common.isAbsolute var setopts = common.setopts var ownProp = common.ownProp @@ -23,7 +24,7 @@ function globSync (pattern, options) { function GlobSync (pattern, options) { if (!pattern) - throw new Error("must provide pattern") + throw new Error('must provide pattern') if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob') @@ -55,7 +56,7 @@ GlobSync.prototype._process = function (pattern, index, inGlobStar) { // Get the first [n] parts of pattern that are all strings. var n = 0 - while (typeof pattern[n] === "string") { + while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. @@ -76,9 +77,9 @@ GlobSync.prototype._process = function (pattern, index, inGlobStar) { default: // pattern has some string bits in the front. - // whatever it starts with, whether that's "absolute" like /foo/bar, - // or "relative" like "../baz" - prefix = pattern.slice(0, n).join("/") + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') break } @@ -87,10 +88,10 @@ GlobSync.prototype._process = function (pattern, index, inGlobStar) { // get the list of entries. var read if (prefix === null) - read = "." - else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) - prefix = "/" + prefix + prefix = '/' + prefix read = prefix } else read = prefix @@ -116,12 +117,12 @@ GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === "." + 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) { + if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) @@ -150,13 +151,13 @@ GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { - if (prefix.slice(-1) !== "/") - e = prefix + "/" + e + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e else e = prefix + e } - if (e.charAt(0) === "/" && !this.nomount) { + if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this.matches[index][e] = true @@ -235,7 +236,7 @@ GlobSync.prototype._readdir = function (abs, inGlobStar) { } try { - return this._readdirEntries(abs, fs.readdirSync(abs).sort(alphasort)) + return this._readdirEntries(abs, fs.readdirSync(abs)) } catch (er) { this._readdirError(abs, er) return null @@ -249,10 +250,10 @@ 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 === "/") + if (abs === '/') e = abs + e else - e = abs + "/" + e + e = abs + '/' + e this.cache[e] = true } } @@ -266,21 +267,21 @@ GlobSync.prototype._readdirEntries = function (abs, entries) { GlobSync.prototype._readdirError = function (f, er) { // handle errors, and cache the information switch (er.code) { - case "ENOTDIR": // totally normal. means it *does* exist. + case 'ENOTDIR': // totally normal. means it *does* exist. this.cache[f] = 'FILE' break - case "ENOENT": // not terribly unusual - case "ELOOP": - case "ENAMETOOLONG": - case "UNKNOWN": + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': this.cache[f] = false break default: // some unusual error. Treat as failure. this.cache[f] = false if (this.strict) throw er - if (!this.silent) console.error("glob error", er) + if (!this.silent) console.error('glob error', er) break } } @@ -312,7 +313,7 @@ GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index for (var i = 0; i < len; i++) { var e = entries[i] - if (e.charAt(0) === "." && !this.dot) + if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state @@ -338,7 +339,7 @@ GlobSync.prototype._processSimple = function (prefix, index) { if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === "/") { + if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) @@ -347,8 +348,8 @@ GlobSync.prototype._processSimple = function (prefix, index) { } } - if (process.platform === "win32") - prefix = prefix.replace(/\\/g, "/") + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') // Mark this as a match this.matches[index][prefix] = true @@ -357,7 +358,7 @@ GlobSync.prototype._processSimple = function (prefix, index) { // Returns either 'DIR', 'FILE', or false GlobSync.prototype._stat = function (f) { var abs = f - if (f.charAt(0) === "/") + if (f.charAt(0) === '/') abs = path.join(this.root, f) else if (this.changedCwd) abs = path.resolve(this.cwd, f) @@ -373,7 +374,7 @@ GlobSync.prototype._stat = function (f) { c = 'DIR' // It exists, but not how we need it - if (abs.slice(-1) === "/" && c !== 'DIR') + if (abs.slice(-1) === '/' && c !== 'DIR') return false return c @@ -391,7 +392,7 @@ GlobSync.prototype._stat = function (f) { this.statCache[abs] = stat - if (abs.slice(-1) === "/" && !stat.isDirectory()) + if (abs.slice(-1) === '/' && !stat.isDirectory()) return false var c = stat.isDirectory() ? 'DIR' : 'FILE' |