moved to es6 module system

This commit is contained in:
Dolan Miu
2016-03-28 00:53:24 +01:00
parent 5c419cd3c4
commit 7a78dacf8c
19 changed files with 19265 additions and 24 deletions

25
ts/export/formatter.ts Normal file
View File

@ -0,0 +1,25 @@
import * as _ from "lodash";
export class Formatter {
format(input: any) {
var stringified = JSON.stringify(input);
var newJson = JSON.parse(stringified);
this.deepTraverseJson(newJson, (parent, value, key) => {
parent.blah = parent[key];
});
return newJson;
}
private deepTraverseJson(json, lambda: (json: any, value: any, key: string) => void) {
_.forOwn(json, function(value, key) {
if (_.isObject(value)) {
this.deepTraverseJson(value, lambda);
return;
}
lambda(json, value, key);
});
};
}