Added eslint and fixed an issue from #158
This commit is contained in:
parent
3ed1d775ac
commit
5939dec185
6 changed files with 36 additions and 13 deletions
|
@ -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]+/);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue