mirror of
https://github.com/logos-storage/nim-serde.git
synced 2026-01-09 00:53:08 +00:00
Change parseJson to JsonNode.parse
Exporting `parseJson` causes symbol clashes in downstream repos that import std/json, so changing the signature completely avoid this clash.
This commit is contained in:
parent
6bd69489a7
commit
6d1de535d8
@ -6,8 +6,9 @@ import ./types
|
||||
|
||||
{.push raises: [].}
|
||||
|
||||
proc parseJson*(json: string): ?!JsonNode =
|
||||
## fix for nim raising Exception
|
||||
proc parse*(_: type JsonNode, json: string): ?!JsonNode =
|
||||
# Used as a replacement for `std/json.parseJson`. Will not raise Exception like in the
|
||||
# standard library
|
||||
try:
|
||||
return stdjson.parseJson(json).catch
|
||||
except Exception as e:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user