Skip to content

Commit

Permalink
move file-watcher util func to correct place
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed Apr 22, 2021
1 parent d66a7e2 commit 33375d6
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions lib/setup/file-watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,24 @@ export default async function fileWatcher(fileOrFolderInputs, closure, closureOn
}
});
}
}

function cleanWatchers(watcher) {
Object.keys(watcher).forEach((watcherKey) => watcher[watcherKey].close());
function cleanWatchers(watcher) {
Object.keys(watcher).forEach((watcherKey) => watcher[watcherKey].close());

return watcher;
}
return watcher;
}

function pathIsForBuild(path) {
return ['.js', '.ts', '.html'].some((extension) => path.endsWith(extension));
}
function pathIsForBuild(path) {
return ['.js', '.ts', '.html'].some((extension) => path.endsWith(extension));
}

function getEventColor(event) {
if (event === 'change') {
return kleur.yellow('CHANGED:');
} else if (event === 'add' || event === 'addDir') {
return kleur.green('ADDED:');
} else if (event === 'unlink' || event === 'unlinkDir') {
return kleur.red('REMOVED:');
}
function getEventColor(event) {
if (event === 'change') {
return kleur.yellow('CHANGED:');
} else if (event === 'add' || event === 'addDir') {
return kleur.green('ADDED:');
} else if (event === 'unlink' || event === 'unlinkDir') {
return kleur.red('REMOVED:');
}
}

0 comments on commit 33375d6

Please sign in to comment.