mirror of
https://github.com/status-im/nim-json-serialization.git
synced 2025-02-19 13:34:19 +00:00
allow serializing distinct arrays (#97)
A complement to https://github.com/status-im/nim-json-serialization/pull/93
This commit is contained in:
parent
8b51cd8bc9
commit
b83739b430
@ -365,7 +365,11 @@ proc writeValue*(w: var JsonWriter, value: auto) {.gcsafe, raises: [IOError].} =
|
|||||||
# to avoid the allocation here:
|
# to avoid the allocation here:
|
||||||
append $value
|
append $value
|
||||||
|
|
||||||
elif value is (seq or array or openArray):
|
elif value is (seq or array or openArray) or
|
||||||
|
(value is distinct and distinctBase(value) is (seq or array or openArray)):
|
||||||
|
when value is distinct:
|
||||||
|
w.writeArray(distinctBase value)
|
||||||
|
else:
|
||||||
w.writeArray(value)
|
w.writeArray(value)
|
||||||
|
|
||||||
elif value is (distinct or object or tuple):
|
elif value is (distinct or object or tuple):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user