From eedfc60f6b4e7e98037290743dd6533f2f4d3220 Mon Sep 17 00:00:00 2001 From: Zeedif Date: Mon, 27 Apr 2026 09:47:00 -0600 Subject: [PATCH] fix(opds): add parens for mixed logical operators and use Number.isNaN --- opds.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opds.js b/opds.js index 2c03114..6f34654 100644 --- a/opds.js +++ b/opds.js @@ -122,7 +122,7 @@ const getPrice = link => { if (!prices.length) return const parsed = prices.reduce((acc, price) => { const value = parseFloat(price.textContent) - if (!isNaN(value)) { + if (!Number.isNaN(value)) { acc.push({ currency: price.getAttribute('currencycode') ?? undefined, value, @@ -178,7 +178,7 @@ const getLink = link => { type: link.getAttribute('type') ?? undefined, title: link.getAttribute('title') ?? undefined, // --- Facet Grouping --- - [FACET_GROUP]: link.getAttributeNS(NS.OPDS, 'facetGroup') || link.getAttribute('opds:facetGroup') ?? undefined, + [FACET_GROUP]: (link.getAttributeNS(NS.OPDS, 'facetGroup') || link.getAttribute('opds:facetGroup')) ?? undefined, properties: { price: (isAcquisition || isStream) ? getPrice(link) : undefined, indirectAcquisition: (isAcquisition || isStream) ? getIndirectAcquisition(link) : undefined,