adjective-animal
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -0,1 +1,5 @@ | ||
# 1.1.2 | ||
* fix empty animal/adjective | ||
# 1.1.1 | ||
@@ -2,0 +6,0 @@ |
12
index.js
@@ -5,5 +5,13 @@ "use strict"; | ||
const animals=fs.readFileSync(__dirname+"/animals.txt","utf8").split("\n").map(animal => animal.toLowerCase().trim().replace(" ","-")); | ||
const adjectives=fs.readFileSync(__dirname+"/adjectives.txt","utf8").split("\n").map(animal => animal.toLowerCase().trim().replace(" ","-")); | ||
function fileToArray(fileName) | ||
{ | ||
return fs.readFileSync(__dirname+"/"+fileName,"utf8") | ||
.split("\n") | ||
.map(animal => animal.toLowerCase().trim().replace(" ","-")) | ||
.filter(a => a!=""); | ||
} | ||
const animals=fileToArray("animals.txt"); | ||
const adjectives=fileToArray("adjectives.txt"); | ||
function generateName() | ||
@@ -10,0 +18,0 @@ { |
{ | ||
"name": "adjective-animal", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Generate an adjective-animal name !", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
16493
30