refactor(compiler): clean up I18nMetaVisitor constructor (#32937)

The initialization of the `_createI18nMessage` property
can be done where it is declared to avoid needing to
type it as `any`.

PR Close #32937
This commit is contained in:
Pete Bacon Darwin 2019-10-01 14:46:38 +01:00 committed by atscott
parent 447fa2fccd
commit fc28b266cd
1 changed files with 3 additions and 5 deletions

View File

@ -33,14 +33,12 @@ function setI18nRefs(html: html.Node & {i18n?: i18n.AST}, i18n: i18n.Node) {
* stored with other element's and attribute's information.
*/
export class I18nMetaVisitor implements html.Visitor {
private _createI18nMessage: any;
// i18n message generation factory
private _createI18nMessage = createI18nMessageFactory(this.interpolationConfig);
constructor(
private interpolationConfig: InterpolationConfig = DEFAULT_INTERPOLATION_CONFIG,
private keepI18nAttrs: boolean = false) {
// i18n message generation factory
this._createI18nMessage = createI18nMessageFactory(interpolationConfig);
}
private keepI18nAttrs: boolean = false, private i18nLegacyMessageIdFormat: string = '') {}
private _generateI18nMessage(
nodes: html.Node[], meta: string|i18n.AST = '',