Skip to content

Instantly share code, notes, and snippets.

@Yardanico Yardanico/near.nim Secret

Created Aug 1, 2020
Embed
What would you like to do?
import json
type
KeyValue = tuple[key: string; val: string]
proc tt(x: KeyValue) =
var it = x
let a = (it.key, it.val)
echo a
proc encodedQuery(node: JsonNode): string =
var query: seq[KeyValue]
for q in node.pairs:
query.add (key: "hello", val: $q.val)
for elem in query:
elem.tt()
proc main =
var cq = newJObject()
cq["a"] = newJInt(1)
cq["b"] = newJInt(2)
let enc = cq.encodedQuery()
echo enc
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.