genius-lyrics-ts
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -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
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
18525
451