diff options
| author | Chris Cast <[email protected]> | 2013-05-10 10:32:18 -0700 |
|---|---|---|
| committer | Chris Cast <[email protected]> | 2013-05-10 10:32:18 -0700 |
| commit | cce5d927e7e847c780e828972c92113d4cb7199f (patch) | |
| tree | 0c1c239df7547a9835d4cdcbf26342619f270f5a /lib | |
| parent | 3c2c44dbe66f8006fc6da319fd63a6fb85888bd6 (diff) | |
| download | faker-cce5d927e7e847c780e828972c92113d4cb7199f.tar.xz faker-cce5d927e7e847c780e828972c92113d4cb7199f.zip | |
Add range param to lorem.sentence
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/lorem.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/lorem.js b/lib/lorem.js index 7010fca9..16a3aec8 100644 --- a/lib/lorem.js +++ b/lib/lorem.js @@ -8,13 +8,14 @@ var lorem = { return Helpers.shuffle(definitions.lorem).slice(0, num); }, - sentence: function (wordCount) { + sentence: function (wordCount, range) { if (typeof wordCount == 'undefined') { wordCount = 3; } + if (typeof range == 'undefined') { range = 7; } // strange issue with the node_min_test failing for captialize, please fix and add this back - //return this.words(wordCount + Helpers.randomNumber(7)).join(' ').capitalize(); + //return this.words(wordCount + Helpers.randomNumber(range)).join(' ').capitalize(); - return this.words(wordCount + Faker.random.number(7)).join(' '); + return this.words(wordCount + Faker.random.number(range)).join(' '); }, sentences: function (sentenceCount) { |
