refactor(): use const and let instead of var
This commit is contained in:

committed by
Victor Berchet

parent
73593d4bf3
commit
77ee27c59e
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user