Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,19 @@ func ToArray() *arrayFormatter {
func (af *arrayFormatter) AddTo(n *Node) {
n.ChildrenAlwaysAsArray = true
}


//Formatting nodes
type NodeFormat struct {
Path string
Plugin nodePlugin
}

//making list of node formatter
func FormatNodes(nfs []NodeFormat) *nodesFormatter {
var nsf []nodeFormatter
for _, nf := range nfs {
nsf = append(nsf, nodeFormatter{path: nf.Path, plugin: nf.Plugin})
}
return WithNodes(nsf...)
}