From 7bf3687dad2f22e3db07dc466c145baffa179979 Mon Sep 17 00:00:00 2001 From: Ben Einaudi Date: Wed, 14 Dec 2016 15:41:59 +0100 Subject: [PATCH] fix(url-generation): Fix empty words Close #7 --- url-generator.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/url-generator.js b/url-generator.js index cf1132b..8b82041 100644 --- a/url-generator.js +++ b/url-generator.js @@ -66,9 +66,9 @@ UriGenerator.prototype.generateUrl = function () { error("url generation not ready: file are not all loaded"); return null; } else { - return this.adv[Math.floor(Math.random() * this.adv.length) + 1] + '-' + - this.adj[Math.floor(Math.random() * this.adj.length) + 1] + '-' + - this.noun[Math.floor(Math.random() * this.noun.length) + 1]; + return this.adv[Math.floor(Math.random() * this.adv.length)] + '-' + + this.adj[Math.floor(Math.random() * this.adj.length)] + '-' + + this.noun[Math.floor(Math.random() * this.noun.length)]; } };