0.6.1
fix: catch and warn if remove watcher is called but no watcher was started.master
parent
3d036ac7a0
commit
f903ef7071
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@uci-utils/watcher",
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.1",
|
||||
"description": "File System Watcher Class that emits events",
|
||||
"main": "src/watcher.js",
|
||||
"type": "module",
|
||||
|
|
|
@ -102,9 +102,11 @@ class Watcher extends Emitter {
|
|||
}
|
||||
|
||||
remove() {
|
||||
if (this._watcher) {
|
||||
this.stop()
|
||||
this._watcher.removeAllListeners()
|
||||
delete (this._watcher)
|
||||
} else log.warn('no watcher started nothing to remove')
|
||||
this._ready = false
|
||||
this.emit('ready', false)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue