From 34c2c439d4e18438e9e004faea660dd07167a149 Mon Sep 17 00:00:00 2001 From: Brandon Slade Date: Wed, 15 Aug 2018 15:34:30 -0600 Subject: Ensure faker.random.word does not return more than one word --- lib/random.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/random.js') diff --git a/lib/random.js b/lib/random.js index 8dccf376..16d638d2 100644 --- a/lib/random.js +++ b/lib/random.js @@ -180,8 +180,8 @@ function Random (faker, seed) { // randomly pick from the many faker methods that can generate words var randomWordMethod = faker.random.arrayElement(wordMethods); - return faker.fake('{{' + randomWordMethod + '}}'); - + var result = faker.fake('{{' + randomWordMethod + '}}'); + return faker.random.arrayElement(result.split(' ')); } /** -- cgit v1.2.3