json.== handles nil now
This commit is contained in:
parent
be534279da
commit
bd8f5c8392
1 changed files with 6 additions and 2 deletions
|
|
@ -621,9 +621,13 @@ proc `%`*(elements: openArray[PJsonNode]): PJsonNode =
|
|||
|
||||
proc `==`* (a,b: PJsonNode): bool =
|
||||
## Check two nodes for equality
|
||||
if a.kind != b.kind: false
|
||||
if a.isNil:
|
||||
if b.isNil: return true
|
||||
return false
|
||||
elif b.isNil or a.kind != b.kind:
|
||||
return false
|
||||
else:
|
||||
case a.kind
|
||||
return case a.kind
|
||||
of JString:
|
||||
a.str == b.str
|
||||
of JInt:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue