diff options
| author | Brandon Slade <[email protected]> | 2018-08-15 15:34:30 -0600 |
|---|---|---|
| committer | Brandon Slade <[email protected]> | 2018-08-15 16:17:16 -0600 |
| commit | 34c2c439d4e18438e9e004faea660dd07167a149 (patch) | |
| tree | a15d83d69f082ed3721252ed99d26a6287a74d6b /lib/random.js | |
| parent | 3a4bb358614c1e1f5d73f4df45c13a1a7aa013d7 (diff) | |
| download | faker-34c2c439d4e18438e9e004faea660dd07167a149.tar.xz faker-34c2c439d4e18438e9e004faea660dd07167a149.zip | |
Ensure faker.random.word does not return more than one word
Diffstat (limited to 'lib/random.js')
| -rw-r--r-- | lib/random.js | 4 |
1 files changed, 2 insertions, 2 deletions
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(' ')); } /** |
