Skip to content

Commit

Permalink
Faker 2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Awilum committed Jan 15, 2022
1 parent abe6216 commit 526d6c1
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Global
node_modules/
coverage
package-lock.json

# OS Generated
.DS_Store*
Expand Down
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.4.0"></a>
# [2.4.0](https://github.com/faker-javascript/faker) (2022-01-15)
* Added new method `sentence` to generate fake sentence value.

<a name="2.3.1"></a>
# [2.3.1](https://github.com/faker-javascript/faker) (2022-01-15)
* Typo updates.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ faker.profession();
[Browse all faker javascript packages](https://github.com/faker-javascript)

## License
[The MIT License (MIT)](https://github.com/faker-javascript/faker/blob/master/LICENSE.txt)
[The MIT License (MIT)](https://github.com/faker-javascript/faker/blob/master/LICENSE)
Copyright (c) [Sergey Romanenko](https://github.com/Awilum)
4 changes: 4 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ interface OptionsProfession {
interface OptionsWord {
length?: number;
}
interface OptionsSentence {
words?: number;
}
declare class Faker {
boolean(): boolean;
integer(options?: OptionsInteger): number;
Expand All @@ -46,6 +49,7 @@ declare class Faker {
profession(options?: OptionsProfession): string;
superhero(): string;
word(options?: OptionsWord): string;
sentence(options?: OptionsSentence): 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 @@ -10,6 +10,7 @@ import string from '@fakerjs/string';
import profession from '@fakerjs/profession';
import superhero from '@fakerjs/superhero';
import word from '@fakerjs/word';
import sentence from '@fakerjs/sentence';

class Faker {
boolean() {
Expand Down Expand Up @@ -59,6 +60,10 @@ class Faker {
word(options) {
return word(options);
}

sentence(options) {
return sentence(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 @@ -13,3 +13,4 @@ expectType<string>(faker.superhero());
expectType<number>(faker.integer());
expectType<number>(faker.float());
expectType<string>(faker.word());
expectType<string>(faker.sentence());
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.3.1",
"version": "2.4.0",
"description": "A set of javascript packages that generates fake data for you.",
"license": "MIT",
"repository": "faker-javascript/faker",
Expand Down Expand Up @@ -46,6 +46,7 @@
"@fakerjs/string": "^2",
"@fakerjs/profession": "^2",
"@fakerjs/superhero": "^1",
"@fakerjs/word": "^1"
"@fakerjs/word": "^1",
"@fakerjs/sentence": "^1"
}
}
4 changes: 4 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ test('faker letter return type to be string', t => {
test('faker word return type to be string', t => {
t.is(typeof faker.word(), 'string');
});

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

0 comments on commit 526d6c1

Please sign in to comment.