mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
fixes #4399
This commit is contained in:
@@ -712,6 +712,7 @@ proc `%`*(b: bool): JsonNode =
|
||||
|
||||
proc `%`*(keyVals: openArray[tuple[key: string, val: JsonNode]]): JsonNode =
|
||||
## Generic constructor for JSON data. Creates a new `JObject JsonNode`
|
||||
if keyvals.len == 0: return newJArray()
|
||||
result = newJObject()
|
||||
for key, val in items(keyVals): result.fields[key] = val
|
||||
|
||||
|
||||
Reference in New Issue
Block a user