Skip to content

Commit

Permalink
Merge branch 'main' into fix/locale-definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT authored May 4, 2022
2 parents e76a955 + 683ee34 commit 43385c2
Show file tree
Hide file tree
Showing 19 changed files with 145 additions and 1,864 deletions.
4 changes: 4 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
{
"groupName": "doc-dependencies",
"matchPackageNames": [
"@algolia/client-search",
"@types/react",
"react",
"react-dom",
"typedoc",
"typedoc-plugin-missing-exports",
"vitepress"
Expand Down
1 change: 0 additions & 1 deletion docs/.vitepress/api-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const apiPages = [
{ text: 'Phone', link: '/api/phone.html' },
{ text: 'Random', link: '/api/random.html' },
{ text: 'System', link: '/api/system.html' },
{ text: 'Time', link: '/api/time.html' },
{ text: 'Unique', link: '/api/unique.html' },
{ text: 'Vehicle', link: '/api/vehicle.html' },
{ text: 'Word', link: '/api/word.html' },
Expand Down
6 changes: 0 additions & 6 deletions docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import { faker } from '@faker-js/faker';

const randomName = faker.name.findName(); // Rowan Nikolaus
const randomEmail = faker.internet.email(); // [email protected]
const randomCard = faker.helpers.createCard(); // An object representing a random contact card containing many properties
```

### Browser
Expand All @@ -60,10 +59,6 @@ const randomCard = faker.helpers.createCard(); // An object representing a rando
// [email protected]
const randomEmail = faker.internet.email();
// An object representing a random contact card
// containing many properties
const randomCard = faker.helpers.createCard();
</script>
```

Expand All @@ -78,7 +73,6 @@ import { faker } from 'https://cdn.skypack.dev/@faker-js/faker';

const randomName = faker.name.findName(); // Willie Bahringer
const randomEmail = faker.internet.email(); // [email protected]
const randomCard = faker.helpers.createCard(); // random contact card containing many properties
```

:::tip Note
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,16 @@
]
},
"devDependencies": {
"@algolia/client-search": "~4.13.0",
"@types/markdown-it": "~12.2.3",
"@types/node": "~17.0.31",
"@types/prettier": "~2.6.0",
"@types/react": "~17.0.44",
"@types/sanitize-html": "~2.6.2",
"@types/validator": "~13.7.2",
"@typescript-eslint/eslint-plugin": "~5.22.0",
"@typescript-eslint/parser": "~5.22.0",
"@vitest/ui": "~0.10.1",
"@vitest/ui": "~0.10.2",
"c8": "~7.11.2",
"conventional-changelog-cli": "~2.2.2",
"cypress": "~9.6.0",
Expand All @@ -114,6 +116,8 @@
"picocolors": "~1.0.0",
"prettier": "2.6.2",
"prettier-plugin-organize-imports": "~2.3.4",
"react": "~17.0.2",
"react-dom": "~17.0.2",
"rimraf": "~3.0.2",
"sanitize-html": "~2.7.0",
"simple-git-hooks": "~2.7.0",
Expand All @@ -124,7 +128,7 @@
"validator": "~13.7.0",
"vite": "~2.9.7",
"vitepress": "~0.22.3",
"vitest": "~0.10.1"
"vitest": "~0.10.2"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
90 changes: 80 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 0 additions & 24 deletions src/faker.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { LocaleDefinition } from './definitions';
import { FakerError } from './errors/faker-error';
import { deprecated } from './internal/deprecated';
import type { KnownLocale } from './locales';
import { Address } from './modules/address';
import { Animal } from './modules/animal';
Expand All @@ -23,7 +22,6 @@ import { Name } from './modules/name';
import { Phone } from './modules/phone';
import { Random } from './modules/random';
import { System } from './modules/system';
import { Time } from './modules/time';
import { Unique } from './modules/unique';
import { Vehicle } from './modules/vehicle';
import { Word } from './modules/word';
Expand All @@ -50,8 +48,6 @@ export class Faker {

readonly definitions: LocaleDefinition = this.initDefinitions();

private _seedValue: number | number[];

readonly fake: Fake['fake'] = new Fake(this).fake;
readonly unique: Unique['unique'] = new Unique().unique;

Expand All @@ -78,7 +74,6 @@ export class Faker {
readonly name: Name = new Name(this);
readonly phone: Phone = new Phone(this);
readonly system: System = new System(this);
readonly time: Time = new Time();
readonly vehicle: Vehicle = new Vehicle(this);
readonly word: Word = new Word(this);

Expand All @@ -100,24 +95,6 @@ export class Faker {
this.localeFallback = opts.localeFallback || 'en';
}

/**
* The seed that was last set.
* Please note that generated values are dependent on both the seed and the number of calls that have been made since it was set.
*
* Use the `seed` function to set a new seed.
*
* @deprecated Use the return value of `faker.seed()` instead.
*/
public get seedValue(): number | number[] {
deprecated({
deprecated: 'faker.seedValue',
proposed: 'return value of faker.seed()',
since: '6.3.0',
until: '7.0.0',
});
return this._seedValue;
}

/**
* Creates a Proxy based LocaleDefinition that virtually merges the locales.
*/
Expand Down Expand Up @@ -235,7 +212,6 @@ export class Faker {
seed(
seed: number | number[] = Math.ceil(Math.random() * Number.MAX_SAFE_INTEGER)
): number | number[] {
this._seedValue = seed;
if (Array.isArray(seed) && seed.length) {
this.mersenne.seed_array(seed);
} else if (!Array.isArray(seed) && !isNaN(seed)) {
Expand Down
Loading

0 comments on commit 43385c2

Please sign in to comment.