refactor: indexOf > includes (in node4)

This commit is contained in:
Remy Sharp
2018-01-08 12:25:01 +00:00
parent 8cec0fc0c7
commit c121187611
3 changed files with 6 additions and 3 deletions

View File

@@ -80,6 +80,10 @@ config.load = function (settings, ready) {
bus.emit('config:update', config);
pinVersion().then(function () {
ready(config);
}).catch(e => {
// this doesn't help testing, but does give exposure on syntax errors
console.error(e.stack);
throw e;
});
});
};

View File

@@ -102,7 +102,6 @@ function run(options) {
debug(spawnArgs);
}
if (config.required) {
var emit = {
stdout: function (data) {
@@ -264,7 +263,7 @@ function run(options) {
// swallow the stdin error if it happens
// ref: https://github.com/remy/nodemon/issues/1195
child.stdin.on('error', () => {});
child.stdin.on('error', () => { });
process.stdin.pipe(child.stdin);
bus.once('exit', function () {

View File

@@ -158,7 +158,7 @@ function nodemon(settings) {
rule = rule.slice(1);
// don't notify of default ignores
if (defaults.ignoreRoot.includes(rule)) {
if (defaults.ignoreRoot.indexOf(rule) !== -1) {
return false;
return rule.slice(3).slice(0, -3);
}