-
-
Save charmander/fe39887b56fd16cff19ef88e6211d100 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.playlistExists = (name, playlists) => ({ | |
index: playlists.findIndex(p => p.name.toLowerCase() === name.toLowerCase()), | |
}); | |
exports.createPlaylist = name => | |
exports.playlists() | |
.then(playlists => exports.playlistExists(name, playlists.items)) | |
.then(response => { | |
if (response.index === -1) { | |
} | |
return response; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment