const spotifyTrackRegex = /^https?:\/\/open\.spotify\.com\/track\/(\w+)/;
export const extractSpotifyId = (url) => {
    const match = url.match(spotifyTrackRegex);
    return match ? match[1] : '';
};
/**
 * Return Spotify embed URL.
 * @param  url link to Spotify track.
 */
export const getSpotifyEmbedUrl = (url) => {
    return 'https://open.spotify.com/embed/track/' + extractSpotifyId(url) + '?utm_source=generator';
};
//# sourceMappingURL=getSpotifyEmbedUrl.js.map