fix(typings): repair broken type-checking for StringMap
Note that the previous type of StringMap was overly permissive and didn't catch errors. Also we have to explicitly type empty objects, which is explained here: https://github.com/Microsoft/TypeScript/issues/5089 Closes #4487
This commit is contained in:
@ -113,9 +113,9 @@ export class CompileDirectiveMetadata {
|
||||
lifecycleHooks?: LifecycleHooks[],
|
||||
template?: CompileTemplateMetadata
|
||||
} = {}): CompileDirectiveMetadata {
|
||||
var hostListeners = {};
|
||||
var hostProperties = {};
|
||||
var hostAttributes = {};
|
||||
var hostListeners: {[key: string]: string} = {};
|
||||
var hostProperties: {[key: string]: string} = {};
|
||||
var hostAttributes: {[key: string]: string} = {};
|
||||
if (isPresent(host)) {
|
||||
StringMapWrapper.forEach(host, (value: string, key: string) => {
|
||||
var matches = RegExpWrapper.firstMatch(HOST_REG_EXP, key);
|
||||
@ -128,7 +128,7 @@ export class CompileDirectiveMetadata {
|
||||
}
|
||||
});
|
||||
}
|
||||
var inputsMap = {};
|
||||
var inputsMap: {[key: string]: string} = {};
|
||||
if (isPresent(inputs)) {
|
||||
inputs.forEach((bindConfig: string) => {
|
||||
// canonical syntax: `dirProp: elProp`
|
||||
@ -137,7 +137,7 @@ export class CompileDirectiveMetadata {
|
||||
inputsMap[parts[0]] = parts[1];
|
||||
});
|
||||
}
|
||||
var outputsMap = {};
|
||||
var outputsMap: {[key: string]: string} = {};
|
||||
if (isPresent(outputs)) {
|
||||
outputs.forEach((bindConfig: string) => {
|
||||
// canonical syntax: `dirProp: elProp`
|
||||
|
Reference in New Issue
Block a user