diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-24 15:10:37 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-24 15:11:17 +0200 |
commit | 7a3df06eb573d36142bd1a8e03c5ce8752d300b3 (patch) | |
tree | 70bfaea8884c374876f607774850a3a51c0cb381 /node_modules/chokidar/index.js | |
parent | aca1143cb9eed16cf37f04e475e4257418dd18ac (diff) | |
download | wallet-core-7a3df06eb573d36142bd1a8e03c5ce8752d300b3.tar.xz |
fix build issues and add typedoc
Diffstat (limited to 'node_modules/chokidar/index.js')
-rw-r--r-- | node_modules/chokidar/index.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/node_modules/chokidar/index.js b/node_modules/chokidar/index.js index e23a64377..4006e080b 100644 --- a/node_modules/chokidar/index.js +++ b/node_modules/chokidar/index.js @@ -76,6 +76,7 @@ function FSWatcher(_opts) { if (undef('ignorePermissionErrors')) opts.ignorePermissionErrors = false; if (undef('interval')) opts.interval = 100; if (undef('binaryInterval')) opts.binaryInterval = 300; + if (undef('disableGlobbing')) opts.disableGlobbing = false; this.enableBinaryInterval = opts.binaryInterval !== opts.interval; // Enable fsevents on OS X when polling isn't explicitly enabled. @@ -104,6 +105,10 @@ function FSWatcher(_opts) { opts.usePolling = !!envLower } } + var envInterval = process.env.CHOKIDAR_INTERVAL; + if (envInterval) { + opts.interval = parseInt(envInterval); + } // Editor atomic write normalization enabled by default with fs.watch if (undef('atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents; @@ -377,7 +382,7 @@ FSWatcher.prototype._isIgnored = function(path, stats) { var replacerRe = /^\.[\/\\]/; FSWatcher.prototype._getWatchHelpers = function(path, depth) { path = path.replace(replacerRe, ''); - var watchPath = depth || !isGlob(path) ? path : globParent(path); + var watchPath = depth || this.options.disableGlobbing || !isGlob(path) ? path : globParent(path); var fullWatchPath = sysPath.resolve(watchPath); var hasGlob = watchPath !== path; var globFilter = hasGlob ? anymatch(path) : false; @@ -465,7 +470,7 @@ FSWatcher.prototype._getWatchedDir = function(directory) { if (!(dir in this._watched)) this._watched[dir] = { _items: Object.create(null), add: function(item) { - if (item !== '.') this._items[item] = true; + if (item !== '.' && item !== '..') this._items[item] = true; }, remove: function(item) { delete this._items[item]; @@ -619,7 +624,7 @@ FSWatcher.prototype.add = function(paths, _origAdd, _internal) { }.bind(this)); }.bind(this), function(error, results) { results.forEach(function(item) { - if (!item) return; + if (!item || this.closed) return; this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item)); }, this); }.bind(this)); |