Skip to content

Commit

Permalink
refactor(internet): deprecated redundant avatar method (#2601)
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT authored Jan 18, 2024
1 parent 872c855 commit d71bc47
Showing 1 changed file with 13 additions and 3 deletions.
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

0 comments on commit d71bc47

Please sign in to comment.