Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(internet): deprecated redundant avatar method #2601

Merged
merged 3 commits into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/modules/internet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,26 @@ export class InternetModule extends ModuleBase {
/**
* Returns a random avatar url.
*
* @see faker.image.avatarLegacy(): For the replacement method.
* @see faker.image.avatar(): For the replacement method with a wider variety of avatars.
*
* @example
* faker.internet.avatar()
* // 'https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/315.jpg'
*
* @since 2.0.1
*
* @deprecated Use `faker.image.avatar()` instead.
*/
avatar(): string {
return `https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/${this.faker.number.int(
1249
)}.jpg`;
deprecated({
deprecated: 'faker.internet.avatar()',
proposed: 'faker.image.avatarLegacy() or faker.image.avatar()',
since: '8.4',
until: '9.0',
});
// TODO @ST-DDT 2024-01-14: Remove or replace with `faker.image.avatar()` in v9
return this.faker.image.avatarLegacy();
}

/**
Expand Down