mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2026-03-18 06:08:58 +00:00
Fix "TypeError: fetch is not a function" in Node.js environment (#1052)
This commit is contained in:
@@ -32,7 +32,7 @@ import config from './config';
|
||||
*/
|
||||
function HKP(keyServerBaseUrl) {
|
||||
this._baseUrl = keyServerBaseUrl || config.keyserver;
|
||||
this._fetch = typeof global !== 'undefined' ? global.fetch : require('node-fetch');
|
||||
this._fetch = typeof global.fetch === 'function' ? global.fetch : require('node-fetch');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user