refactor(TypeScript): Add noImplicitAny
We automatically insert explicit 'any's where needed. These need to be addressed as in #9100. Fixes #4924
This commit is contained in:
@ -107,7 +107,7 @@ export class XHRConnection implements Connection {
|
||||
});
|
||||
}
|
||||
|
||||
setDetectedContentType(req, _xhr) {
|
||||
setDetectedContentType(req: any /** TODO #9100 */, _xhr: any /** TODO #9100 */) {
|
||||
// Skip if a custom Content-Type header is provided
|
||||
if (isPresent(req.headers) && isPresent(req.headers['Content-Type'])) {
|
||||
return;
|
||||
|
@ -128,11 +128,11 @@ export class Headers {
|
||||
toJSON(): {[key: string]: any} {
|
||||
let serializableHeaders = {};
|
||||
this._headersMap.forEach((values: string[], name: string) => {
|
||||
let list = [];
|
||||
let list: any[] /** TODO #9100 */ = [];
|
||||
|
||||
iterateListLike(values, val => list = ListWrapper.concat(list, val.split(',')));
|
||||
iterateListLike(values, (val: any /** TODO #9100 */) => list = ListWrapper.concat(list, val.split(',')));
|
||||
|
||||
serializableHeaders[name] = list;
|
||||
(serializableHeaders as any /** TODO #9100 */)[name] = list;
|
||||
});
|
||||
return serializableHeaders;
|
||||
}
|
||||
|
@ -168,6 +168,6 @@ export class Request {
|
||||
|
||||
const noop = function () {};
|
||||
const w = typeof window == 'object' ? window : noop;
|
||||
const FormData = w['FormData'] || noop;
|
||||
const Blob = w['Blob'] || noop;
|
||||
const ArrayBuffer = w['ArrayBuffer'] || noop;
|
||||
const FormData = (w as any /** TODO #9100 */)['FormData'] || noop;
|
||||
const Blob = (w as any /** TODO #9100 */)['Blob'] || noop;
|
||||
const ArrayBuffer = (w as any /** TODO #9100 */)['ArrayBuffer'] || noop;
|
||||
|
@ -264,7 +264,7 @@ export function main() {
|
||||
'application/x-www-form-urlencoded;charset=UTF-8');
|
||||
});
|
||||
|
||||
if (global['Blob']) {
|
||||
if ((global as any /** TODO #9100 */)['Blob']) {
|
||||
it('should use FormData body and detect content type header to the request', () => {
|
||||
var body = new FormData();
|
||||
body.append('test1', 'val1');
|
||||
@ -385,7 +385,7 @@ export function main() {
|
||||
existingXHRs[0].dispatchEvent('load');
|
||||
}));
|
||||
|
||||
it('should set ok to true on 200 return', inject([AsyncTestCompleter], async => {
|
||||
it('should set ok to true on 200 return', inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
|
||||
var statusCode = 200;
|
||||
var connection = new XHRConnection(sampleRequest, new MockBrowserXHR(),
|
||||
new ResponseOptions({status: statusCode}));
|
||||
@ -399,7 +399,7 @@ export function main() {
|
||||
existingXHRs[0].dispatchEvent('load');
|
||||
}));
|
||||
|
||||
it('should set ok to false on 300 return', inject([AsyncTestCompleter], async => {
|
||||
it('should set ok to false on 300 return', inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
|
||||
var statusCode = 300;
|
||||
var connection = new XHRConnection(sampleRequest, new MockBrowserXHR(),
|
||||
new ResponseOptions({status: statusCode}));
|
||||
|
@ -65,9 +65,9 @@ export function main() {
|
||||
|
||||
|
||||
describe('.toJSON()', () => {
|
||||
let headers = null;
|
||||
let inputArr = null;
|
||||
let obj = null;
|
||||
let headers: any /** TODO #9100 */ = null;
|
||||
let inputArr: any /** TODO #9100 */ = null;
|
||||
let obj: any /** TODO #9100 */ = null;
|
||||
|
||||
beforeEach(() => {
|
||||
headers = new Headers();
|
||||
|
Reference in New Issue
Block a user