Merge branch 'master' of github.com:Araq/Nimrod
This commit is contained in:
commit
ddedefd4c4
1 changed files with 3 additions and 1 deletions
|
|
@ -641,11 +641,13 @@ proc `[]`*(node: PJsonNode, index: Int): PJsonNode =
|
||||||
assert(node.kind == JArray)
|
assert(node.kind == JArray)
|
||||||
return node.elems[index]
|
return node.elems[index]
|
||||||
|
|
||||||
proc existsKey*(node: PJsonNode, key: String): Bool =
|
proc hasKey*(node: PJsonNode, key: String): Bool =
|
||||||
## Checks if `key` exists in `node`.
|
## Checks if `key` exists in `node`.
|
||||||
assert(node.kind == JObject)
|
assert(node.kind == JObject)
|
||||||
for k, item in items(node.fields):
|
for k, item in items(node.fields):
|
||||||
if k == key: return True
|
if k == key: return True
|
||||||
|
proc existsKey*(node: PJsonNode, key: String): Bool {.deprecated.} = node.hasKey(key)
|
||||||
|
## Deprecated for `hasKey`
|
||||||
|
|
||||||
proc add*(father, child: PJsonNode) =
|
proc add*(father, child: PJsonNode) =
|
||||||
## Adds `child` to a JArray node `father`.
|
## Adds `child` to a JArray node `father`.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue