Skip to content

Commit

Permalink
d
Browse files Browse the repository at this point in the history
  • Loading branch information
Patitotective committed Aug 21, 2023
1 parent 1b11a31 commit 9dadc4d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/kdl/nodes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -265,21 +265,17 @@ proc `[]=`*(node: var KdlNode, key: string, val: KdlVal) =
## Sets the key property to val in node.
node.props[key] = val

proc hasKey*(node: KdlNode, key: string): bool =
## Checks if node has the key property.
node.props.hasKey(key)

proc contains*(node: KdlNode, key: string): bool =
## Checks if node has the key property.
node.props.contains(key)
key in node.props

proc contains*(node: KdlNode, val: KdlVal): bool =
## Checks if node has the val argument.
node.args.contains(val)
val in node.args

proc contains*(node: KdlNode, child: KdlNode): bool =
## Checks if node has the child children.
node.children.contains(child)
child in node.children

proc contains*(doc: KdlDoc, name: string): bool =
## Checks if doc has a node called name
Expand Down

0 comments on commit 9dadc4d

Please sign in to comment.