Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

spotify-url-info

Package Overview
Dependencies
Maintainers
2
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spotify-url-info - npm Package Compare versions

Comparing version 2.2.9 to 3.0.0

README.md

20

package.json

@@ -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",

23

src/index.js
'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)
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc