node-csfd-api 2.8.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,7 +35,8 @@ const getBirthdayInfo = (el) => {
35
35
  };
36
36
  exports.getBirthdayInfo = getBirthdayInfo;
37
37
  const getBio = (el) => {
38
- return el.querySelector('.article-content p').text.trim().split('\n')[0].trim();
38
+ var _a;
39
+ return ((_a = el.querySelector('.article-content p')) === null || _a === void 0 ? void 0 : _a.text.trim().split('\n')[0].trim()) || null;
39
40
  };
40
41
  exports.getBio = getBio;
41
42
  const getPhoto = (el) => {
@@ -30,9 +30,11 @@ const getPoster = (el) => {
30
30
  };
31
31
  exports.getPoster = getPoster;
32
32
  const getOrigins = (el) => {
33
- var _a;
34
- const originsRaw = el.querySelector('.article-content p .info').text;
35
- const originsAll = (_a = originsRaw === null || originsRaw === void 0 ? void 0 : originsRaw.split(', ')) === null || _a === void 0 ? void 0 : _a[0];
33
+ var _a, _b;
34
+ const originsRaw = (_a = el.querySelector('.article-content p .info')) === null || _a === void 0 ? void 0 : _a.text;
35
+ if (!originsRaw)
36
+ return [];
37
+ const originsAll = (_b = originsRaw === null || originsRaw === void 0 ? void 0 : originsRaw.split(', ')) === null || _b === void 0 ? void 0 : _b[0];
36
38
  return originsAll === null || originsAll === void 0 ? void 0 : originsAll.split('/').map((country) => country.trim());
37
39
  };
38
40
  exports.getOrigins = getOrigins;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-csfd-api",
3
- "version": "2.8.0",
3
+ "version": "2.9.0",
4
4
  "description": "ČSFD API in JavaScript. Amazing NPM library for scrapping csfd.cz :)",
5
5
  "main": "./index.js",
6
6
  "author": "BART! <bart@bartweb.cz>",