Add nodes with render and transform

This commit is contained in:
Misode
2020-05-24 02:40:14 +02:00
parent 135b229265
commit d96949c605
6 changed files with 129 additions and 2 deletions

11
src/nodes/StringNode.ts Normal file
View File

@@ -0,0 +1,11 @@
import { AbstractNode, NodeMods } from './AbstractNode'
export class StringNode extends AbstractNode<string> {
constructor(mods?: NodeMods<string>) {
super(mods)
}
render(field: string, value: string) {
return `<span>${field}</span> <span>${value || ''}</span>`
}
}