Skip to content

Commit

Permalink
WKD: Fix "TypeError: fetch is not a function" in Node.js environment …
Browse files Browse the repository at this point in the history
…(#1181)
  • Loading branch information
YarmoM authored Nov 17, 2020
1 parent 08fc7b3 commit a4b56c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wkd.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import * as keyMod from './key';
* @constructor
*/
function WKD() {
this._fetch = typeof global !== 'undefined' ? global.fetch : require('node-fetch');
this._fetch = typeof global.fetch === 'function' ? global.fetch : require('node-fetch');
}

/**
Expand Down

0 comments on commit a4b56c9

Please sign in to comment.