Skip to content
This repository was archived by the owner on Mar 18, 2019. It is now read-only.

replaced isomorphic-fetch by cross-fetch #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ coverage

# Output of 'npm pack'
*.tgz
.idea
3 changes: 2 additions & 1 deletion lib/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ class LinkLookupError extends Error {
}

class ErrorMessage extends Error {
constructor (message, content) {
constructor (message, content, response) {
super(message)
this.message = message
this.content = content
this.name = 'ErrorMessage'
this.response = response
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/transports/http.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const fetch = require('isomorphic-fetch')
const fetch = require('cross-fetch')
const errors = require('../errors')
const utils = require('../utils')
const URL = require('url-parse')
Expand Down Expand Up @@ -132,7 +132,7 @@ class HTTPTransport {
return data
} else {
const title = response.status + ' ' + response.statusText
const error = new errors.ErrorMessage(title, data)
const error = new errors.ErrorMessage(title, data, response)
return Promise.reject(error)
}
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"testRegex": "/tests/.*\\.(ts|tsx|js)$"
},
"dependencies": {
"isomorphic-fetch": "^2.2.1",
"cross-fetch": "^2.2.2",
"url-parse": "^1.1.7",
"url-template": "^2.0.8"
},
Expand Down
Loading