Skip to content

Commit

Permalink
chore(BUILD): fix broken build (#3285)
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
benlesh authored Feb 1, 2018
1 parent 5bc7de1 commit d487d6b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/internal/observable/dom/AjaxObservable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,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 d487d6b

Please sign in to comment.