Added eslint and fixed an issue from #158

This commit is contained in:
John Crepezzi 2017-06-26 12:19:36 -04:00
parent 3ed1d775ac
commit 5939dec185
6 changed files with 36 additions and 13 deletions

View file

@ -2,13 +2,11 @@ var fs = require('fs');
var DictionaryGenerator = function(options) {
//Options
if (!options)
return done(Error('No options passed to generator'));
if (!options.path)
return done(Error('No dictionary path specified in options'));
if (!options) throw Error('No options passed to generator');
if (!options.path) throw Error('No dictionary path specified in options');
//Load dictionary
fs.readFile(options.path, 'utf8', (err,data) => {
fs.readFile(options.path, 'utf8', (err, data) => {
if (err) throw err;
this.dictionary = data.split(/[\n\r]+/);
});