mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 12:33:03 +00:00
19 lines
426 B
TypeScript
19 lines
426 B
TypeScript
/**
|
|
* Turns a list of artists into a string of artists separated by commas.
|
|
* @param artists artists array to put commas in
|
|
* @returns a string with commas in between each artist
|
|
*/
|
|
export default (artists: string[]) => {
|
|
let result = [];
|
|
|
|
artists.forEach((i, index, artists) => {
|
|
if (index !== artists.length - 1) {
|
|
result.push(i + ", ");
|
|
} else {
|
|
result.push(i);
|
|
}
|
|
});
|
|
|
|
return result;
|
|
};
|