* Generates a random avatar image url. * * @remark This method sometimes generates a random string representing an URL from GitHub by using a random user ID. Faker is not responsible for the content of the image or the service providing it. * * @example * faker.image.avatar() * //
()
| 32 | * @since 2.0.1 |
| 33 | */ |
| 34 | avatar(): string { |
| 35 | // Add new avatar providers here, when adding a new one. |
| 36 | const avatarMethod = this.faker.helpers.arrayElement([ |
| 37 | this.personPortrait, |
| 38 | this.avatarGitHub, |
| 39 | ]); |
| 40 | return avatarMethod(); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Generates a random avatar from GitHub. |
no test coverage detected