glob-watcher
Advanced tools
Comparing version 5.0.0 to 5.0.1
14
index.js
@@ -15,2 +15,14 @@ 'use strict'; | ||
function listenerCount(ee, evtName) { | ||
if (typeof ee.listenerCount === 'function') { | ||
return ee.listenerCount(evtName); | ||
} | ||
return ee.listeners(evtName).length; | ||
} | ||
function hasErrorListener(ee) { | ||
return listenerCount(ee, 'error') !== 0; | ||
} | ||
function watch(glob, options, cb) { | ||
@@ -36,3 +48,3 @@ if (typeof options === 'function') { | ||
if (err) { | ||
if (err && hasErrorListener(watcher)) { | ||
watcher.emit('error', err); | ||
@@ -39,0 +51,0 @@ } |
{ | ||
"name": "glob-watcher", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "Watch globs and execute a function upon change, with intelligent defaults for debouncing and queueing.", | ||
@@ -5,0 +5,0 @@ "author": "Gulp Team <team@gulpjs.com> (http://gulpjs.com/)", |
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
9574
66