spotify-url-info
Advanced tools
Comparing version 2.2.9 to 3.0.0
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://github.com/microlinkhq/spotify-url-info", | ||
"version": "2.2.9", | ||
"version": "3.0.0", | ||
"main": "src/index.js", | ||
@@ -16,2 +16,18 @@ "author": { | ||
"email": "josefrancisco.verdu@gmail.com" | ||
}, | ||
{ | ||
"name": "DaliborTrampota", | ||
"email": "dalibor.trampota@gmail.com" | ||
}, | ||
{ | ||
"name": "crxts", | ||
"email": "49580728+crxts@users.noreply.github.com" | ||
}, | ||
{ | ||
"name": "kaaax0815", | ||
"email": "999999bst@gmail.com" | ||
}, | ||
{ | ||
"name": "KeepSOBP", | ||
"email": "keepsobp@naver.com" | ||
} | ||
@@ -35,3 +51,2 @@ ], | ||
"dependencies": { | ||
"cross-fetch": "~3.1.4", | ||
"himalaya": "~1.1.0", | ||
@@ -47,2 +62,3 @@ "spotify-uri": "~2.2.0" | ||
"conventional-github-releaser": "latest", | ||
"cross-fetch": "latest", | ||
"finepack": "latest", | ||
@@ -49,0 +65,0 @@ "git-authors-cli": "latest", |
'use strict' | ||
const spotifyURI = require('spotify-uri') | ||
const { fetch } = require('cross-fetch') | ||
const { parse } = require('himalaya') | ||
@@ -9,3 +9,3 @@ | ||
function getData (url, opts) { | ||
const createGetData = fetch => (url, opts) => { | ||
let parsedURL = {} | ||
@@ -75,3 +75,3 @@ | ||
function parseIntoPreview (data) { | ||
function toPreview (data) { | ||
const track = getFirstTrack(data) | ||
@@ -103,3 +103,3 @@ const images = data.type === 'track' ? data.album.images : data.images | ||
function parseIntoTrackArray (data) { | ||
function getTracks (data) { | ||
if (!data.tracks) { | ||
@@ -160,8 +160,9 @@ // Is a track or a podcast episode | ||
module.exports.getData = getData | ||
module.exports.getPreview = (url, opts) => | ||
getData(url, opts).then(parseIntoPreview) | ||
module.exports.getTracks = (url, opts) => | ||
getData(url, opts).then(parseIntoTrackArray) | ||
module.exports = fetch => { | ||
const getData = createGetData(fetch) | ||
return { | ||
getData, | ||
getPreview: (url, opts) => getData(url, opts).then(toPreview), | ||
getTracks: (url, opts) => getData(url, opts).then(getTracks) | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13568
2
189
16
2
- Removedcross-fetch@~3.1.4
- Removedcross-fetch@3.1.8(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)