node-csfd-api
Advanced tools
Comparing version 3.0.0-next.5 to 3.0.0-next.6
@@ -17,3 +17,4 @@ "use strict"; | ||
const cross_fetch_1 = require("cross-fetch"); | ||
const fetch = (_a = ((typeof global === 'object' && global.fetch) || | ||
const fetchSafe = (_a = ((typeof fetch === 'function' && fetch) || | ||
(typeof global === 'object' && global.fetch) || | ||
(typeof window !== 'undefined' && window.fetch))) !== null && _a !== void 0 ? _a : cross_fetch_1.fetch; | ||
@@ -31,3 +32,3 @@ const USER_AGENTS = [ | ||
try { | ||
const response = yield fetch(url, { headers }); | ||
const response = yield fetchSafe(url, { headers }); | ||
if (response.status >= 400 && response.status < 600) { | ||
@@ -34,0 +35,0 @@ throw new Error(`node-csfd-api: Bad response ${response.status} for url: ${url}`); |
@@ -14,3 +14,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { fetch as crossFetch } from 'cross-fetch'; | ||
const fetch = (_a = ((typeof global === 'object' && global.fetch) || | ||
const fetchSafe = (_a = ((typeof fetch === 'function' && fetch) || | ||
(typeof global === 'object' && global.fetch) || | ||
(typeof window !== 'undefined' && window.fetch))) !== null && _a !== void 0 ? _a : crossFetch; | ||
@@ -28,3 +29,3 @@ const USER_AGENTS = [ | ||
try { | ||
const response = yield fetch(url, { headers }); | ||
const response = yield fetchSafe(url, { headers }); | ||
if (response.status >= 400 && response.status < 600) { | ||
@@ -31,0 +32,0 @@ throw new Error(`node-csfd-api: Bad response ${response.status} for url: ${url}`); |
{ | ||
"name": "node-csfd-api", | ||
"version": "3.0.0-next.5", | ||
"version": "3.0.0-next.6", | ||
"description": "ČSFD API in JavaScript. Amazing NPM library for scrapping csfd.cz :)", | ||
@@ -5,0 +5,0 @@ "main": "./cjs/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
105020
2085
4