Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Success
next()
return
} else if (method === 'watchFile') {
// Check
if (fsUtil.watchFile == null) {
const err = new Error(
'watchFile method is not supported on this environment, fs.watchFile does not exist'
)
next(err)
return
}
// Watch
try {
fsUtil.watchFile(
this.path,
{
persistent: this.config.persistent,
interval: this.config.interval
},
(...args) => this.listener({ method, args })
)
} catch (err) {
next(err)
return
}
// Success
next()
return
} else {