From cce5d927e7e847c780e828972c92113d4cb7199f Mon Sep 17 00:00:00 2001 From: Chris Cast Date: Fri, 10 May 2013 10:32:18 -0700 Subject: Add range param to lorem.sentence --- examples/js/Faker.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/js/Faker.js b/examples/js/Faker.js index c34922eb..3ac04b0e 100644 --- a/examples/js/Faker.js +++ b/examples/js/Faker.js @@ -17,7 +17,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************** AUTOGENERATED @ 1363758276883 *************** +/*************** AUTOGENERATED @ 1368206971573 *************** WARNING: THIS FILE WAS AUTOGENERATED BY THE FAKER BUILD SCRIPT MODIFYING THIS FILE IS FINE, BUT YOU REALLY SHOULD BE MODIFYING THE LIBRARY DIRECTLY AND REGENERATING THIS FILE USING BUILD.js!!!! @@ -239,13 +239,14 @@ Faker.Lorem.words = function (num) { return Helpers.shuffle(definitions.lorem).slice(0, num); }; -Faker.Lorem.sentence = function (wordCount) { +Faker.Lorem.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(' '); }; Faker.Lorem.sentences = function (sentenceCount) { -- cgit v1.2.3