node-csfd-api
Advanced tools
Comparing version 2.7.2 to 2.7.3
@@ -31,5 +31,6 @@ "use strict"; | ||
const ratingRaw = el.querySelector('.film-rating-average').textContent; | ||
const rating = +(ratingRaw === null || ratingRaw === void 0 ? void 0 : ratingRaw.replace(/%/g, '').trim()); | ||
if (Number.isInteger(rating)) { | ||
return rating; | ||
const rating = ratingRaw === null || ratingRaw === void 0 ? void 0 : ratingRaw.replace(/%/g, '').trim(); | ||
const ratingInt = parseInt(rating); | ||
if (Number.isInteger(ratingInt)) { | ||
return ratingInt; | ||
} | ||
@@ -94,3 +95,6 @@ else { | ||
const namesNode = el.querySelectorAll('.film-names li'); | ||
return namesNode.map((el) => { | ||
if (!namesNode.length) { | ||
return []; | ||
} | ||
const titlesOther = namesNode.map((el) => { | ||
const country = el.querySelector('img.flag').attributes.alt; | ||
@@ -108,2 +112,3 @@ const title = el.textContent.trim().split('\n')[0]; | ||
}); | ||
return titlesOther.filter((x) => x); | ||
}; | ||
@@ -110,0 +115,0 @@ exports.getTitlesOther = getTitlesOther; |
{ | ||
"name": "node-csfd-api", | ||
"version": "2.7.2", | ||
"version": "2.7.3", | ||
"description": "ČSFD API in JavaScript. Amazing NPM library for scrapping csfd.cz :)", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
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
64472
1160