WKD: Fix "TypeError: fetch is not a function" in Node.js environment (#1181)
This commit is contained in:
parent
08fc7b32ca
commit
a4b56c944a
|
@ -31,7 +31,7 @@ import * as keyMod from './key';
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function WKD() {
|
function WKD() {
|
||||||
this._fetch = typeof global !== 'undefined' ? global.fetch : require('node-fetch');
|
this._fetch = typeof global.fetch === 'function' ? global.fetch : require('node-fetch');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user