Comparing version 1.4.1 to 1.5.0
{ | ||
"name": "sane", | ||
"version": "1.4.1", | ||
"version": "1.5.0", | ||
"description": "Sane aims to be fast, small, and reliable file system watcher.", | ||
@@ -16,3 +16,3 @@ "main": "index.js", | ||
"prepublish": "jshint --config=.jshintrc src/ index.js && mocha --bail", | ||
"test": "jshint --config=.jshintrc src/ index.js && mocha --bail", | ||
"test": "jshint --config=.jshintrc src/ index.js && mocha --bail test/test.js && mocha --bail test/utils-test.js", | ||
"test:debug": "mocha debug --bail" | ||
@@ -32,2 +32,3 @@ }, | ||
"dependencies": { | ||
"anymatch": "^1.3.0", | ||
"exec-sh": "^0.2.0", | ||
@@ -34,0 +35,0 @@ "fb-watchman": "^1.8.0", |
@@ -0,1 +1,3 @@ | ||
[![CircleCI](https://circleci.com/gh/amasad/sane.svg?style=svg)](https://circleci.com/gh/amasad/sane) | ||
sane | ||
@@ -2,0 +4,0 @@ ---- |
'use strict'; | ||
var anymatch = require('anymatch'); | ||
var minimatch = require('minimatch'); | ||
@@ -31,2 +32,7 @@ | ||
} | ||
watcher.hasIgnore = Boolean(opts.ignored) && | ||
!(Array.isArray(opts) && opts.length > 0); | ||
watcher.doIgnore = opts.ignored ? anymatch(opts.ignored) : function () { | ||
return false; | ||
}; | ||
return opts; | ||
@@ -44,7 +50,8 @@ }; | ||
exports.isFileIncluded = function(globs, dot, relativePath) { | ||
exports.isFileIncluded = function(globs, dot, doIgnore, relativePath) { | ||
var matched; | ||
if (globs.length) { | ||
for (var i = 0; i < globs.length; i++) { | ||
if (minimatch(relativePath, globs[i], {dot: dot})) { | ||
if (minimatch(relativePath, globs[i], {dot: dot}) && | ||
!doIgnore(relativePath)) { | ||
matched = true; | ||
@@ -56,9 +63,6 @@ break; | ||
// Make sure we honor the dot option if even we're not using globs. | ||
if (!dot) { | ||
matched = minimatch(relativePath, '**/*', {dot: false}); | ||
} else { | ||
matched = true; | ||
} | ||
matched = (dot || minimatch(relativePath, '**/*')) && | ||
!doIgnore(relativePath); | ||
} | ||
return matched; | ||
}; |
@@ -75,3 +75,7 @@ 'use strict'; | ||
var relativePath = path.relative(this.root, filepath); | ||
if (!common.isFileIncluded(this.globs, this.dot, relativePath)) { | ||
if (!common.isFileIncluded( | ||
this.globs, | ||
this.dot, | ||
this.doIgnore, | ||
relativePath)) { | ||
return false; | ||
@@ -280,3 +284,7 @@ } | ||
this.watchdir(fullPath); | ||
if (common.isFileIncluded(this.globs, this.dot, relativePath)) { | ||
if (common.isFileIncluded( | ||
this.globs, | ||
this.dot, | ||
this.doIgnore, | ||
relativePath)) { | ||
this.emitEvent(ADD_EVENT, relativePath, stat); | ||
@@ -283,0 +291,0 @@ } |
@@ -63,2 +63,3 @@ 'use strict'; | ||
this.dot, | ||
this.doIgnore, | ||
path.relative(this.root, filepath) | ||
@@ -65,0 +66,0 @@ ); |
@@ -217,4 +217,8 @@ 'use strict'; | ||
if (!self.capabilities.wildmatch && | ||
!common.isFileIncluded(this.globs, this.dot, relativePath)) { | ||
if (!(self.capabilities.wildmatch && !this.hasIgnore) && | ||
!common.isFileIncluded( | ||
this.globs, | ||
this.dot, | ||
this.doIgnore, | ||
relativePath)) { | ||
return; | ||
@@ -221,0 +225,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28135
839
128
7
+ Addedanymatch@^1.3.0
+ Addedanymatch@1.3.2(transitive)
+ Addedarr-diff@2.0.0(transitive)
+ Addedarr-flatten@1.1.0(transitive)
+ Addedarray-unique@0.2.1(transitive)
+ Addedbraces@1.8.5(transitive)
+ Addedexpand-brackets@0.1.5(transitive)
+ Addedexpand-range@1.8.2(transitive)
+ Addedextglob@0.3.2(transitive)
+ Addedfilename-regex@2.0.1(transitive)
+ Addedfill-range@2.2.4(transitive)
+ Addedfor-in@1.0.2(transitive)
+ Addedfor-own@0.1.5(transitive)
+ Addedglob-base@0.3.0(transitive)
+ Addedglob-parent@2.0.0(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedis-dotfile@1.0.3(transitive)
+ Addedis-equal-shallow@0.1.3(transitive)
+ Addedis-extendable@0.1.1(transitive)
+ Addedis-extglob@1.0.0(transitive)
+ Addedis-glob@2.0.1(transitive)
+ Addedis-number@2.1.04.0.0(transitive)
+ Addedis-posix-bracket@0.1.1(transitive)
+ Addedis-primitive@2.0.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisobject@2.1.0(transitive)
+ Addedkind-of@3.2.26.0.3(transitive)
+ Addedmath-random@1.0.4(transitive)
+ Addedmicromatch@2.3.11(transitive)
+ Addednormalize-path@2.1.1(transitive)
+ Addedobject.omit@2.0.1(transitive)
+ Addedparse-glob@3.0.4(transitive)
+ Addedpreserve@0.2.0(transitive)
+ Addedrandomatic@3.1.1(transitive)
+ Addedregex-cache@0.4.4(transitive)
+ Addedremove-trailing-separator@1.1.0(transitive)
+ Addedrepeat-element@1.1.4(transitive)
+ Addedrepeat-string@1.6.1(transitive)