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

genius-lyrics-ts

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

genius-lyrics-ts - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

17

dist/index.js

@@ -42,7 +42,6 @@ "use strict";

throw '"apiKey" property is missing from options';
} else if (!title) {
throw '"title" property is missing from options';
} else if (!artist) {
throw '"artist" property is missing from options';
}
if (!title && !artist) {
throw '"title" and "artist" property is missing from options';
}
};

@@ -62,3 +61,3 @@ var getTitle = (title, artist) => {

try {
let response = await fetch(url, { method: "GET" });
let response = await fetch(url);
const data = await response.text();

@@ -97,9 +96,3 @@ const $ = cheerio.load(data);

const reqUrl = `${searchUrl}${encodeURIComponent(song)}`;
const headers = {
Authorization: "Bearer " + apiKey
};
const data = await (await fetch(`${reqUrl}&access_token=${apiKey}`, {
method: "GET",
headers: new Headers(headers)
})).json();
const data = await (await fetch(`${reqUrl}&access_token=${apiKey}`)).json();
const hits = data.response.hits;

@@ -106,0 +99,0 @@ if (hits.length === 0)

{
"name": "genius-lyrics-ts",
"version": "0.0.5",
"version": "0.0.6",
"description": "Get lyrics from genius with Typescript, Javascript, or Node",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -8,3 +8,3 @@ import * as cheerio from "cheerio";

try {
let response = await fetch(url, { method: "GET" });
let response = await fetch(url);
const data = await response.text();

@@ -11,0 +11,0 @@ const $ = cheerio.load(data);

@@ -12,7 +12,6 @@ export type Options = {

throw '"apiKey" property is missing from options';
} else if (!title) {
throw '"title" property is missing from options';
} else if (!artist) {
throw '"artist" property is missing from options';
}
if (!title && !artist) {
throw '"title" and "artist" property is missing from options';
}
};

@@ -19,0 +18,0 @@

@@ -22,11 +22,3 @@ import { Options, checkOptions, getTitle } from ".";

const reqUrl = `${searchUrl}${encodeURIComponent(song)}`;
const headers = {
Authorization: "Bearer " + apiKey,
};
const data = await (
await fetch(`${reqUrl}&access_token=${apiKey}`, {
method: "GET",
headers: new Headers(headers),
})
).json();
const data = await (await fetch(`${reqUrl}&access_token=${apiKey}`)).json();

@@ -33,0 +25,0 @@ const hits = data.response.hits;

Sorry, the diff of this file is not supported yet

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