node-csfd-api 3.0.0-next.4 → 3.0.0-next.5
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.
- package/cjs/fetchers/index.js +6 -1
- package/esm/fetchers/index.js +6 -1
- package/package.json +2 -2
package/cjs/fetchers/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// import fetch from 'cross-fetch';
|
|
3
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -9,8 +8,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
9
|
});
|
|
11
10
|
};
|
|
11
|
+
var _a;
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.fetchPage = void 0;
|
|
14
|
+
// Check if `fetch` is available in global scope (nodejs 18+) or in window (browser)
|
|
15
|
+
// If not, use cross-fetch polyfill
|
|
16
|
+
const cross_fetch_1 = require("cross-fetch");
|
|
17
|
+
const fetch = (_a = ((typeof global === 'object' && global.fetch) ||
|
|
18
|
+
(typeof window !== 'undefined' && window.fetch))) !== null && _a !== void 0 ? _a : cross_fetch_1.fetch;
|
|
14
19
|
const USER_AGENTS = [
|
|
15
20
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
|
|
16
21
|
'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/87.0.4280.77 Mobile/15E148 Safari/604.1',
|
package/esm/fetchers/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// import fetch from 'cross-fetch';
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,6 +7,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
10
|
+
var _a;
|
|
11
|
+
// Check if `fetch` is available in global scope (nodejs 18+) or in window (browser)
|
|
12
|
+
// If not, use cross-fetch polyfill
|
|
13
|
+
import { fetch as crossFetch } from 'cross-fetch';
|
|
14
|
+
const fetch = (_a = ((typeof global === 'object' && global.fetch) ||
|
|
15
|
+
(typeof window !== 'undefined' && window.fetch))) !== null && _a !== void 0 ? _a : crossFetch;
|
|
11
16
|
const USER_AGENTS = [
|
|
12
17
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
|
|
13
18
|
'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/87.0.4280.77 Mobile/15E148 Safari/604.1',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-csfd-api",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.5",
|
|
4
4
|
"description": "ČSFD API in JavaScript. Amazing NPM library for scrapping csfd.cz :)",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"author": "BART! <bart@bartweb.cz>",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"lint": "eslint ./src/**/**/* --fix",
|
|
16
16
|
"test": "jest",
|
|
17
17
|
"fix-paths": "yarn json -I -f ./dist/package.json -e \"this.module='./esm/index.js';this.main='./cjs/index.js';this.types='./types/index.d.ts'\"",
|
|
18
|
-
"publish:next": "yarn && yarn build && yarn test --coverage true && cd dist && npm publish --tag
|
|
18
|
+
"publish:next": "yarn && yarn build && yarn test --coverage true && cd dist && npm publish --tag next",
|
|
19
19
|
"postversion": "git push && git push --follow-tags",
|
|
20
20
|
"release:beta": "npm version preminor --preid=beta -m \"chore(update): prelease %s β\"",
|
|
21
21
|
"prerelease:beta": "npm version prerelease --preid=beta -m \"chore(update): prelease %s β\"",
|