Skip to content

Commit

Permalink
Merge pull request #106 from ConsenSys/URL_fix
Browse files Browse the repository at this point in the history
Change initialization of URL class for browser compatibility
  • Loading branch information
nbanmp committed Apr 26, 2019
2 parents 3b63a23 + adc2bdb commit 356bd60
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var URL
URL = URL || require('url').URL
URL = (typeof window !== 'undefined' && window.URL)
? window.URL : require('url').URL

const requester = require('./lib/requester')
const simpleRequester = require('./lib/simpleRequester')
Expand Down
3 changes: 2 additions & 1 deletion lib/util.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var URL
URL = URL || require('url').URL
URL = (typeof window !== 'undefined' && window.URL)
? window.URL : require('url').URL

/**
* Wait for the specified time.
Expand Down
3 changes: 2 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var URL
URL = URL || require('url').URL
URL = (typeof window !== 'undefined' && window.URL)
? window.URL : require('url').URL

const armlet = require('../index')
const Client = require('../index').Client
Expand Down
3 changes: 2 additions & 1 deletion test/lib/analysisPoller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var URL
URL = URL || require('url').URL
URL = (typeof window !== 'undefined' && window.URL)
? window.URL : require('url').URL

const nock = require('nock')
const sinon = require('sinon')
Expand Down
3 changes: 2 additions & 1 deletion test/lib/login.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var URL
URL = URL || require('url').URL
URL = (typeof window !== 'undefined' && window.URL)
? window.URL : require('url').URL

const nock = require('nock')
require('chai')
Expand Down
3 changes: 2 additions & 1 deletion test/lib/refresh.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var URL
URL = URL || require('url').URL
URL = (typeof window !== 'undefined' && window.URL)
? window.URL : require('url').URL

const nock = require('nock')
require('chai')
Expand Down
3 changes: 2 additions & 1 deletion test/lib/requester.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var URL
URL = URL || require('url').URL
URL = (typeof window !== 'undefined' && window.URL)
? window.URL : require('url').URL

const nock = require('nock')
require('chai')
Expand Down

0 comments on commit 356bd60

Please sign in to comment.