mirror of
https://github.com/misode/misode.github.io.git
synced 2026-05-07 07:51:46 +00:00
Add conditional rendering
This commit is contained in:
@@ -19,12 +19,12 @@ export class ObjectNode extends AbstractNode<IObject> {
|
||||
})
|
||||
}
|
||||
|
||||
transform(value: IObject) {
|
||||
transform(path: Path, value: IObject) {
|
||||
if (value === undefined) return undefined
|
||||
value = value || {}
|
||||
let res: any = {}
|
||||
Object.keys(this.fields).forEach(f =>
|
||||
res[f] = this.fields[f].transform(value[f])
|
||||
res[f] = this.fields[f].transform(path.push(f), value[f])
|
||||
)
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user