Skip to content

Commit d71bc47

Browse files
authored
refactor(internet): deprecated redundant avatar method (#2601)
1 parent 872c855 commit d71bc47

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/modules/internet/index.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,26 @@ export class InternetModule extends ModuleBase {
4141
/**
4242
* Returns a random avatar url.
4343
*
44+
* @see faker.image.avatarLegacy(): For the replacement method.
45+
* @see faker.image.avatar(): For the replacement method with a wider variety of avatars.
46+
*
4447
* @example
4548
* faker.internet.avatar()
4649
* // 'https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/315.jpg'
4750
*
4851
* @since 2.0.1
52+
*
53+
* @deprecated Use `faker.image.avatar()` instead.
4954
*/
5055
avatar(): string {
51-
return `https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/${this.faker.number.int(
52-
1249
53-
)}.jpg`;
56+
deprecated({
57+
deprecated: 'faker.internet.avatar()',
58+
proposed: 'faker.image.avatarLegacy() or faker.image.avatar()',
59+
since: '8.4',
60+
until: '9.0',
61+
});
62+
// TODO @ST-DDT 2024-01-14: Remove or replace with `faker.image.avatar()` in v9
63+
return this.faker.image.avatarLegacy();
5464
}
5565

5666
/**

0 commit comments

Comments
 (0)