Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public static materializeTree(tree: any): any {
if (tree.termType) {
return getTermRaw(tree);
} else if (Array.isArray(tree)) {
return tree.map(Converter.materializeTree);
} else {
const materialized: any = {};
for (const key in tree) {
materialized[key] = Converter.materializeTree(tree[key]);
}
return materialized;
}
}