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:
ScottSWu
2016-06-08 15:45:15 -07:00
parent 87d824e1b4
commit 86fbd50c3d
305 changed files with 2338 additions and 2337 deletions

View File

@ -166,7 +166,7 @@ class SanitizingHtmlSerializer {
}
}
private chars(chars) { this.buf.push(encodeEntities(chars)); }
private chars(chars: any /** TODO #9100 */) { this.buf.push(encodeEntities(chars)); }
}
// Regular Expressions for parsing tags and attributes
@ -181,16 +181,16 @@ const NON_ALPHANUMERIC_REGEXP = /([^\#-~ |!])/g;
* @param value
* @returns {string} escaped text
*/
function encodeEntities(value) {
function encodeEntities(value: any /** TODO #9100 */) {
return value.replace(/&/g, '&')
.replace(SURROGATE_PAIR_REGEXP,
function(match) {
function(match: any /** TODO #9100 */) {
let hi = match.charCodeAt(0);
let low = match.charCodeAt(1);
return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';
})
.replace(NON_ALPHANUMERIC_REGEXP,
function(match) { return '&#' + match.charCodeAt(0) + ';'; })
function(match: any /** TODO #9100 */) { return '&#' + match.charCodeAt(0) + ';'; })
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
}