From 0275b65c7aceef2709b5e270108247648d91730b Mon Sep 17 00:00:00 2001 From: Jannis R Date: Mon, 24 Oct 2022 16:58:54 +0200 Subject: [PATCH] =?UTF-8?q?fetch-ponyfill=20&=20pinkie-promise=20->=20cros?= =?UTF-8?q?s-fetch=20=F0=9F=92=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cross-fetch requires `globalThis.Promise` to be present. --- lib/request.js | 3 +-- package.json | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/request.js b/lib/request.js index 9b66186f..04204030 100644 --- a/lib/request.js +++ b/lib/request.js @@ -8,8 +8,7 @@ const {randomBytes} = require('crypto') const createHash = require('create-hash') const pick = require('lodash/pick') const {stringify} = require('qs') -const Promise = require('pinkie-promise') -const {Request, fetch} = require('fetch-ponyfill')({Promise}) +const {Request, fetch} = require('cross-fetch') const {parse: parseContentType} = require('content-type') const {byErrorCode} = require('./errors') diff --git a/package.json b/package.json index 8f03119c..1593a787 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "@derhuerst/round-robin-scheduler": "^1.0.4", "content-type": "^1.0.4", "create-hash": "^1.2.0", - "fetch-ponyfill": "^7.0.0", + "cross-fetch": "^3.1.5", "google-polyline": "^1.0.3", "gps-distance": "0.0.4", "https-proxy-agent": "^5.0.0", @@ -57,7 +57,6 @@ "object-scan": "^13.0.0", "p-retry": "^4.1.0", "p-throttle": "^4.1.1", - "pinkie-promise": "^2.0.1", "qs": "^6.6.0", "slugg": "^1.2.0" },