fixed all tslint errors

This commit is contained in:
Dolan Miu
2016-05-26 15:08:34 +01:00
parent f075d3b719
commit a2284df881
42 changed files with 253 additions and 254 deletions

View File

@ -6,8 +6,8 @@ export class Formatter {
format(input: any): Object {
input.clearVariables();
this.replaceKeys(input);
var newJson = this.clense(input);
//console.log(JSON.stringify(newJson, null, " "));
let newJson = this.clense(input);
// console.log(JSON.stringify(newJson, null, " "));
return newJson;
}
@ -18,7 +18,7 @@ export class Formatter {
}
private clense(input: any): Object {
var newJson = this.jsonify(input);
let newJson = this.jsonify(input);
this.deepTraverseJson(newJson, (parent, value, key) => {
if (key === "properties") {
@ -36,13 +36,13 @@ export class Formatter {
}
private jsonify(obj: Object): Object {
var stringifiedJson = JSON.stringify(obj);
let stringifiedJson = JSON.stringify(obj);
return JSON.parse(stringifiedJson);
}
private deepTraverseJson(json: Object, lambda: (json: any, value: any, key: any) => void): void {
_.forOwn(json, (value, key) => {
if (_.isObject(value) && key !== "xmlKeys" && key != "rootKey") {
if (_.isObject(value) && key !== "xmlKeys" && key !== "rootKey") {
this.deepTraverseJson(value, lambda);
}
lambda(json, value, key);