Skip to content

Commit

Permalink
refactor(random)!: remove deprecated random module (#2678)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Feb 25, 2024
1 parent a9dc701 commit 64ff107
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 850 deletions.
1 change: 0 additions & 1 deletion docs/.vitepress/api-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const apiPages = [
{ text: 'Number', link: '/api/number.html' },
{ text: 'Person', link: '/api/person.html' },
{ text: 'Phone', link: '/api/phone.html' },
{ text: 'Random', link: '/api/random.html' },
{ text: 'Science', link: '/api/science.html' },
{ text: 'String', link: '/api/string.html' },
{ text: 'System', link: '/api/system.html' },
Expand Down
12 changes: 12 additions & 0 deletions docs/guide/upgrading_v9/2678.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Remove deprecated random module

Removed deprecated random module

| old | replacement |
| ----------------------------- | ----------------------------------------------- |
| `faker.random.alpha()` | `faker.string.alpha()` |
| `faker.random.alphaNumeric()` | `faker.string.alphanumeric()` |
| `faker.random.locale()` | `faker.helpers.objectKey(allLocales/allFakers)` |
| `faker.random.numeric()` | `faker.string.numeric()` |
| `faker.random.word()` | `faker.lorem.word()` or `faker.word.sample()` |
| `faker.random.words()` | `faker.lorem.words()` or `faker.word.words()` |
7 changes: 0 additions & 7 deletions src/faker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { MusicModule } from './modules/music';
import type { PersonModule as NameModule } from './modules/person';
import { PersonModule } from './modules/person';
import { PhoneModule } from './modules/phone';
import { RandomModule } from './modules/random';
import { ScienceModule } from './modules/science';
import { SystemModule } from './modules/system';
import { VehicleModule } from './modules/vehicle';
Expand Down Expand Up @@ -62,12 +61,6 @@ export class Faker extends SimpleFaker {
readonly rawDefinitions: LocaleDefinition;
readonly definitions: LocaleProxy;

/**
* @deprecated Use the modules specific to the type of data you want to generate instead.
*/
// eslint-disable-next-line deprecation/deprecation
readonly random: RandomModule = new RandomModule(this);

readonly airline: AirlineModule = new AirlineModule(this);
readonly animal: AnimalModule = new AnimalModule(this);
readonly color: ColorModule = new ColorModule(this);
Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ export type {
SexType,
} from './modules/person';
export type { PhoneModule } from './modules/phone';
// eslint-disable-next-line deprecation/deprecation
export type { RandomModule } from './modules/random';
export type { ChemicalElement, ScienceModule, Unit } from './modules/science';
export type { StringModule } from './modules/string';
export type { SystemModule } from './modules/system';
Expand Down

0 comments on commit 64ff107

Please sign in to comment.