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 3.1.8 to 3.1.9

2

package.json

@@ -5,3 +5,3 @@ {

"homepage": "https://github.com/microlinkhq/spotify-url-info",
"version": "3.1.8",
"version": "3.1.9",
"main": "src/index.js",

@@ -8,0 +8,0 @@ "author": {

@@ -14,2 +14,13 @@ 'use strict'

const ERROR = {
REPORT:
'Please report the problem at https://github.com/microlinkhq/spotify-url-info/issues.',
NOT_DATA: "Couldn't find any data in embed page that we know how to parse.",
NOT_SCRIPTS: "Couldn't find scripts to get the data."
}
const throwError = message => {
throw new TypeError(`${message}\n${ERROR.REPORT}`)
}
const SUPPORTED_TYPES = Object.values(TYPE)

@@ -25,5 +36,8 @@

const scripts = embed
.find(el => el.tagName === 'html')
.children.find(el => el.tagName === 'body')
let scripts = embed.find(el => el.tagName === 'html')
if (scripts === undefined) return throwError(ERROR.NOT_SCRIPTS)
scripts = scripts.children
.find(el => el.tagName === 'body')
.children.filter(({ tagName }) => tagName === 'script')

@@ -53,5 +67,3 @@

throw new Error(
"Couldn't find any data in embed page that we know how to parse.\nPlease report the problem at https://github.com/microlinkhq/spotify-url-info/issues."
)
return throwError(ERROR.NOT_DATA)
}

@@ -58,0 +70,0 @@

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