diff options
Diffstat (limited to 'internal/node/object.go')
-rw-r--r-- | internal/node/object.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/node/object.go b/internal/node/object.go new file mode 100644 index 0000000..35a3141 --- /dev/null +++ b/internal/node/object.go @@ -0,0 +1,22 @@ +package node + +import "go.neonxp.dev/json" + +func (n *Node) SetKeyValue(k string, v json.Node) { + n.objectValue[k] = v.(*Node) +} + +func (n *Node) GetByKey(k string) (json.Node, bool) { + node, ok := n.objectValue[k] + return node, ok +} + +func (n *Node) Merge(n2 *Node) { + for k, v := range n2.objectValue { + n.objectValue[k] = v + } +} + +func (n *Node) RemoveByKey(k string) { + delete(n.objectValue, k) +} |