aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/music/index.ts36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/modules/music/index.ts b/src/modules/music/index.ts
index 332b4530..e3d56715 100644
--- a/src/modules/music/index.ts
+++ b/src/modules/music/index.ts
@@ -5,10 +5,44 @@ import { ModuleBase } from '../../internal/module-base';
*
* ### Overview
*
- * Generate a random music genre with [`genre()`](https://fakerjs.dev/api/music.html#genre) or song name with [`songName()`](https://fakerjs.dev/api/music.html#songname). Both may be localized.
+ * Generate random music content.
+ *
+ * For a random album name, use [`album()`](https://fakerjs.dev/api/music.html#album).
+ *
+ * For a random artist, use [`artist()`](https://fakerjs.dev/api/music.html#artist).
+ *
+ * For a random genre, use [`genre()`](https://fakerjs.dev/api/music.html#genre).
+ *
+ * For a random song name, [`songName()`](https://fakerjs.dev/api/music.html#songname).
+ *
+ * All data types may be localized.
*/
export class MusicModule extends ModuleBase {
/**
+ * Returns a random album name.
+ *
+ * @example
+ * faker.music.album() // '1989'
+ *
+ * @since 9.0.0
+ */
+ album(): string {
+ return this.faker.helpers.arrayElement(this.faker.definitions.music.album);
+ }
+
+ /**
+ * Returns a random artist name.
+ *
+ * @example
+ * faker.music.artist() // 'The Beatles'
+ *
+ * @since 9.0.0
+ */
+ artist(): string {
+ return this.faker.helpers.arrayElement(this.faker.definitions.music.artist);
+ }
+
+ /**
* Returns a random music genre.
*
* @example