Skip to content

Commit

Permalink
Faker 2.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Awilum committed Jan 17, 2022
1 parent 526d6c1 commit 3c3447e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<a name="2.5.0"></a>
# [2.5.0](https://github.com/faker-javascript/faker) (2022-01-17)
* Added new method `paragraph` to generate fake paragraph value.

<a name="2.4.0"></a>
# [2.4.0](https://github.com/faker-javascript/faker) (2022-01-15)
* Added new method `sentence` to generate fake sentence value.
Expand Down
6 changes: 6 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ interface OptionsWord {
interface OptionsSentence {
words?: number;
}
interface OptionsParagraph {
sentences?: number;
wordsMin?: number;
wordsMax?: number;
}
declare class Faker {
boolean(): boolean;
integer(options?: OptionsInteger): number;
Expand All @@ -50,6 +55,7 @@ declare class Faker {
superhero(): string;
word(options?: OptionsWord): string;
sentence(options?: OptionsSentence): string;
paragraph(options?: OptionsParagraph): string;
}
declare const faker: Faker;
export default faker;
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import profession from '@fakerjs/profession';
import superhero from '@fakerjs/superhero';
import word from '@fakerjs/word';
import sentence from '@fakerjs/sentence';
import paragraph from '@fakerjs/paragraph';

class Faker {
boolean() {
Expand Down Expand Up @@ -64,6 +65,10 @@ class Faker {
sentence(options) {
return sentence(options);
}

paragraph(options) {
return paragraph(options);
}
}

const faker = new Faker();
Expand Down
1 change: 1 addition & 0 deletions index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ expectType<number>(faker.integer());
expectType<number>(faker.float());
expectType<string>(faker.word());
expectType<string>(faker.sentence());
expectType<string>(faker.paragraph());
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fakerjs/faker",
"version": "2.4.0",
"version": "2.5.0",
"description": "A set of javascript packages that generates fake data for you.",
"license": "MIT",
"repository": "faker-javascript/faker",
Expand Down Expand Up @@ -47,6 +47,7 @@
"@fakerjs/profession": "^2",
"@fakerjs/superhero": "^1",
"@fakerjs/word": "^1",
"@fakerjs/sentence": "^1"
"@fakerjs/sentence": "^1",
"@fakerjs/paragraph": "^1"
}
}
4 changes: 4 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ test('faker word return type to be string', t => {
test('faker sentence return type to be string', t => {
t.is(typeof faker.sentence(), 'string');
});

test('faker paragraph return type to be string', t => {
t.is(typeof faker.paragraph(), 'string');
});

0 comments on commit 3c3447e

Please sign in to comment.