Skip to content

Commit

Permalink
fix: better require testing
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Mar 12, 2021
1 parent 25c6080 commit 2d359ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/api/api.js
Expand Up @@ -267,7 +267,8 @@ export const buildGetAgent = (AgentHttp, AgentHttps, set = true) => {
* built and set in the globals.
*/
export const patchAgent = () => {
if (!globals.require) return;
if (typeof require !== "function") return;
if (globals.getAgent) return;
let http, https;
try {
http = require("http");
Expand Down

0 comments on commit 2d359ad

Please sign in to comment.