diff options
| author | LBuerstmayr <[email protected]> | 2021-03-01 22:46:26 +0100 |
|---|---|---|
| committer | Marak <[email protected]> | 2021-03-03 20:14:45 -0500 |
| commit | 7ad22c2e2aae2f5e6215bcdb91cf3fd28e727d92 (patch) | |
| tree | 03941188e92583a105c8ef17fde438fb1b52bdcf /lib/lorem.js | |
| parent | 58c61afb1b8baa160add593e5af7c110de011968 (diff) | |
| download | faker-7ad22c2e2aae2f5e6215bcdb91cf3fd28e727d92.tar.xz faker-7ad22c2e2aae2f5e6215bcdb91cf3fd28e727d92.zip | |
Issue 1114: New datatype module
Current status:
- moved number(), float(), hexaDecimal(), boolean(), uuid() from random to datatype
- moved respective test from random.unit to datatype.unit
- tests of moved methods in random now check if DeprecationWarning is printed and respective method in datatype module is called
- adapted all lib files that use moved methods (mostly number)
- adapted tests of respective files to spy on the correct method
- adapted README in order to promote usage of method that logs a DeprecationWarning
Diffstat (limited to 'lib/lorem.js')
| -rw-r--r-- | lib/lorem.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/lorem.js b/lib/lorem.js index c25234cb..f8d4fcef 100644 --- a/lib/lorem.js +++ b/lib/lorem.js @@ -47,7 +47,7 @@ var Lorem = function (faker) { * @param {number} range */ self.sentence = function (wordCount, range) { - if (typeof wordCount == 'undefined') { wordCount = faker.random.number({ min: 3, max: 10 }); } + if (typeof wordCount == 'undefined') { wordCount = faker.datatype.number({ min: 3, max: 10 }); } // if (typeof range == 'undefined') { range = 7; } // strange issue with the node_min_test failing for captialize, please fix and add faker.lorem.back @@ -76,7 +76,7 @@ var Lorem = function (faker) { * @param {string} separator defaults to `' '` */ self.sentences = function (sentenceCount, separator) { - if (typeof sentenceCount === 'undefined') { sentenceCount = faker.random.number({ min: 2, max: 6 });} + if (typeof sentenceCount === 'undefined') { sentenceCount = faker.datatype.number({ min: 2, max: 6 });} if (typeof separator == 'undefined') { separator = " "; } var sentences = []; for (sentenceCount; sentenceCount > 0; sentenceCount--) { @@ -93,7 +93,7 @@ var Lorem = function (faker) { */ self.paragraph = function (sentenceCount) { if (typeof sentenceCount == 'undefined') { sentenceCount = 3; } - return faker.lorem.sentences(sentenceCount + faker.random.number(3)); + return faker.lorem.sentences(sentenceCount + faker.datatype.number(3)); }; /** @@ -134,7 +134,7 @@ var Lorem = function (faker) { * @param {number} lineCount defaults to a random number between 1 and 5 */ self.lines = function lines (lineCount) { - if (typeof lineCount === 'undefined') { lineCount = faker.random.number({ min: 1, max: 5 });} + if (typeof lineCount === 'undefined') { lineCount = faker.datatype.number({ min: 1, max: 5 });} return faker.lorem.sentences(lineCount, '\n') }; |
