Skip to content

Commit

Permalink
feat: include raw response in parsed response
Browse files Browse the repository at this point in the history
  • Loading branch information
ayZagen committed Feb 15, 2021
1 parent f0ff536 commit 5c04c39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ function fetchAsPromise( url: string, options: RequestInit ) {
let response = null
rawResponse.text().then( value => {
if ( contentType && contentType.indexOf( 'application/json' ) > -1 ){
response = JSON.parse( value )
response = Object.assign( JSON.parse( value ), { _raw: rawResponse } )
} else {
response = value
response = { data: value, _raw: rawResponse }
}
// TODO: migrate to object response
// response.__proto__._raw = clone
Expand Down

0 comments on commit 5c04c39

Please sign in to comment.