refactor(): use const and let instead of var

This commit is contained in:
Joao Dias
2016-11-12 14:08:58 +01:00
committed by Victor Berchet
parent 73593d4bf3
commit 77ee27c59e
435 changed files with 4637 additions and 4663 deletions

View File

@ -81,17 +81,17 @@ export function main(): void {
let htmlParser: HtmlParser;
function toXliff(html: string): string {
let catalog = new MessageBundle(new HtmlParser, [], {});
const catalog = new MessageBundle(new HtmlParser, [], {});
catalog.updateFromTemplate(html, '', DEFAULT_INTERPOLATION_CONFIG);
return catalog.write(serializer);
}
function loadAsText(template: string, xliff: string): {[id: string]: string} {
let messageBundle = new MessageBundle(htmlParser, [], {});
const messageBundle = new MessageBundle(htmlParser, [], {});
messageBundle.updateFromTemplate(template, 'url', DEFAULT_INTERPOLATION_CONFIG);
const asAst = serializer.load(xliff, 'url', messageBundle);
let asText: {[id: string]: string} = {};
const asText: {[id: string]: string} = {};
Object.keys(asAst).forEach(id => { asText[id] = serializeNodes(asAst[id]).join(''); });
return asText;

View File

@ -62,7 +62,7 @@ export function main(): void {
}
function toXmb(html: string): string {
let catalog = new MessageBundle(new HtmlParser, [], {});
const catalog = new MessageBundle(new HtmlParser, [], {});
const serializer = new Xmb();
catalog.updateFromTemplate(html, '', DEFAULT_INTERPOLATION_CONFIG);

View File

@ -20,11 +20,11 @@ export function main(): void {
let htmlParser: HtmlParser;
function loadAsText(template: string, xtb: string): {[id: string]: string} {
let messageBundle = new MessageBundle(htmlParser, [], {});
const messageBundle = new MessageBundle(htmlParser, [], {});
messageBundle.updateFromTemplate(template, 'url', DEFAULT_INTERPOLATION_CONFIG);
const asAst = serializer.load(xtb, 'url', messageBundle);
let asText: {[id: string]: string} = {};
const asText: {[id: string]: string} = {};
Object.keys(asAst).forEach(id => { asText[id] = serializeNodes(asAst[id]).join(''); });
return asText;