node-csfd-api 3.0.0-next.3 → 3.0.0-next.4

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.
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ // import fetch from 'cross-fetch';
2
3
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
4
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
5
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,12 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
9
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
10
  });
10
11
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
12
  Object.defineProperty(exports, "__esModule", { value: true });
15
13
  exports.fetchPage = void 0;
16
- const cross_fetch_1 = __importDefault(require("cross-fetch"));
17
14
  const USER_AGENTS = [
18
15
  'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
19
16
  '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',
@@ -25,7 +22,7 @@ const headers = {
25
22
  };
26
23
  const fetchPage = (url) => __awaiter(void 0, void 0, void 0, function* () {
27
24
  try {
28
- const response = yield (0, cross_fetch_1.default)(url, { headers });
25
+ const response = yield fetch(url, { headers });
29
26
  if (response.status >= 400 && response.status < 600) {
30
27
  throw new Error(`node-csfd-api: Bad response ${response.status} for url: ${url}`);
31
28
  }
@@ -1,3 +1,4 @@
1
+ // import fetch from 'cross-fetch';
1
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -7,7 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
9
  });
9
10
  };
10
- import fetch from 'cross-fetch';
11
11
  const USER_AGENTS = [
12
12
  'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
13
13
  '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",
3
+ "version": "3.0.0-next.4",
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>",