Another readObjectFields convenience helper

This commit is contained in:
Zahary Karadjov 2020-08-02 20:15:44 +03:00
parent f011bea54b
commit 1dccd4b2ef
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 5 additions and 0 deletions

View File

@ -519,3 +519,8 @@ proc readValue*[T](r: var JsonReader, value: var T)
else:
const typeName = typetraits.name(T)
{.error: "Failed to convert to JSON an unsupported type: " & typeName.}
iterator readObjectFields*(r: var JsonReader): string =
for key in readObjectFields(r, string):
yield key