genius-lyrics-ts
Advanced tools
Comparing version 0.0.17 to 0.0.18
@@ -28,3 +28,2 @@ "use strict"; | ||
// src/utils/index.ts | ||
var isServer = () => !(typeof window != "undefined" && window.document); | ||
var checkOptions = (options) => { | ||
@@ -54,3 +53,3 @@ let { apiKey, title, artist } = options; | ||
const html = await response.text(); | ||
const htmlDocument = isServer() ? new import_happy_dom.Window().document : window.document; | ||
const htmlDocument = import_happy_dom.Window ? new import_happy_dom.Window().document : window.document; | ||
htmlDocument.body.innerHTML = html; | ||
@@ -57,0 +56,0 @@ let lyrics = htmlDocument.querySelector('div[class="lyrics"]')?.textContent?.trim(); |
{ | ||
"name": "genius-lyrics-ts", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "Get lyrics from genius with Typescript, Javascript, or Node", | ||
"main": "dist/index.js", | ||
"browser": { | ||
"happy-dom": false | ||
"happy-dom": false, | ||
"./dist/index.js": "./dist/index.js" | ||
}, | ||
@@ -9,0 +10,0 @@ "module": "dist/index.mjs", |
import { Window } from "happy-dom"; | ||
import { isServer } from "."; | ||
@@ -12,3 +11,3 @@ /** | ||
const html = await response.text(); | ||
const htmlDocument = isServer() ? new Window().document : window.document; | ||
const htmlDocument = Window ? new Window().document : window.document; | ||
htmlDocument.body.innerHTML = html; | ||
@@ -15,0 +14,0 @@ |
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
14549
334