Skip to content

Commit

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

<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.
Expand Down
8 changes: 8 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ interface OptionsParagraph {
wordsMin?: number;
wordsMax?: number;
}
interface OptionsDomain {
tld?: string;
}
interface OptionsEmail {
domain?: string;
}
declare class Faker {
boolean(): boolean;
integer(options?: OptionsInteger): number;
Expand All @@ -56,6 +62,8 @@ declare class Faker {
word(options?: OptionsWord): string;
sentence(options?: OptionsSentence): string;
paragraph(options?: OptionsParagraph): string;
domain(options?: OptionsDomain): string;
email(options?: OptionsEmail): string;
}
declare const faker: Faker;
export default faker;
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import superhero from '@fakerjs/superhero';
import word from '@fakerjs/word';
import sentence from '@fakerjs/sentence';
import paragraph from '@fakerjs/paragraph';
import domain from '@fakerjs/domain';
import email from '@fakerjs/email';

class Faker {
boolean() {
Expand Down Expand Up @@ -69,6 +71,14 @@ class Faker {
paragraph(options) {
return paragraph(options);
}

domain(options) {
return domain(options);
}

email(options) {
return email(options);
}
}

const faker = new Faker();
Expand Down
2 changes: 2 additions & 0 deletions index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ expectType<number>(faker.float());
expectType<string>(faker.word());
expectType<string>(faker.sentence());
expectType<string>(faker.paragraph());
expectType<string>(faker.domain());
expectType<string>(faker.email());
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fakerjs/faker",
"version": "2.5.0",
"version": "2.6.0",
"description": "A set of javascript packages that generates fake data for you.",
"license": "MIT",
"repository": "faker-javascript/faker",
Expand Down Expand Up @@ -32,7 +32,10 @@
"faker",
"fake",
"random",
"generator"
"generator",
"fake-generator",
"fake-data",
"fake-data-generator"
],
"dependencies": {
"@fakerjs/boolean": "^2",
Expand All @@ -48,6 +51,8 @@
"@fakerjs/superhero": "^1",
"@fakerjs/word": "^1",
"@fakerjs/sentence": "^1",
"@fakerjs/paragraph": "^1"
"@fakerjs/paragraph": "^1",
"@fakerjs/domain": "^1",
"@fakerjs/email": "^1"
}
}
8 changes: 8 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,11 @@ test('faker sentence return type to be string', t => {
test('faker paragraph return type to be string', t => {
t.is(typeof faker.paragraph(), 'string');
});

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

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

0 comments on commit c391805

Please sign in to comment.