Skip to content

Commit

Permalink
chore(BUILD): fix broken build (#3285) (#3369)
Browse files Browse the repository at this point in the history
TypeScript seemed to have an issue with XHR all of a sudden, I presume it's some TS update, quick fix any for now to fix the build
  • Loading branch information
alexeagle authored and benlesh committed Mar 2, 2018
1 parent c009ac6 commit 7d900a1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/observable/dom/AjaxObservable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,13 +462,17 @@ function parseXhrResponse(responseType: string, xhr: XMLHttpRequest) {
//IE does not support json as responseType, parse it internally
return xhr.responseType ? xhr.response : JSON.parse(xhr.response || xhr.responseText || 'null');
} else {
return JSON.parse(xhr.responseText || 'null');
// HACK(benlesh): TypeScript shennanigans
// tslint:disable-next-line:no-any latest TS seems to think xhr is "never" here.
return JSON.parse((xhr as any).responseText || 'null');
}
case 'xml':
return xhr.responseXML;
case 'text':
default:
return ('response' in xhr) ? xhr.response : xhr.responseText;
// HACK(benlesh): TypeScript shennanigans
// tslint:disable-next-line:no-any latest TS seems to think xhr is "never" here.
return ('response' in xhr) ? xhr.response : (xhr as any).responseText;
}
}

Expand Down

0 comments on commit 7d900a1

Please sign in to comment.