diff options
| author | Marak <[email protected]> | 2020-08-23 22:14:13 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-08-23 22:14:13 -0500 |
| commit | a0a88506e3cdeadd547a58f2e40ff945f3a42f51 (patch) | |
| tree | c493c4c1d90c89caa27a5f3cf89455795f321c96 /lib | |
| parent | cf6aea86d3d172b5da4ce362fbe0c80cf90461e9 (diff) | |
| parent | 34c2c439d4e18438e9e004faea660dd07167a149 (diff) | |
| download | faker-a0a88506e3cdeadd547a58f2e40ff945f3a42f51.tar.xz faker-a0a88506e3cdeadd547a58f2e40ff945f3a42f51.zip | |
Merge pull request #683 from blslade-neumont/dev-random-word
Ensure faker.random.word does not return more than one word
Diffstat (limited to 'lib')
| -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 1f99eed3..5afd27e2 100644 --- a/lib/random.js +++ b/lib/random.js @@ -202,8 +202,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(' ')); } /** |
