From d487d6bae508d66363b9c92858bf9f07587f0b05 Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Wed, 31 Jan 2018 19:55:38 -0800 Subject: [PATCH] chore(BUILD): fix broken build (#3285) 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 --- src/internal/observable/dom/AjaxObservable.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/internal/observable/dom/AjaxObservable.ts b/src/internal/observable/dom/AjaxObservable.ts index be45791c5a..0bde0a3eb1 100644 --- a/src/internal/observable/dom/AjaxObservable.ts +++ b/src/internal/observable/dom/AjaxObservable.ts @@ -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; } }