2023-12-14 08:34:13 +07:00
|
|
|
# json-rpc
|
|
|
|
# Copyright (c) 2019-2023 Status Research & Development GmbH
|
|
|
|
# Licensed under either of
|
|
|
|
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
|
|
|
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
|
|
|
# at your option.
|
|
|
|
# This file may not be copied, modified, or distributed except according to
|
|
|
|
# those terms.
|
|
|
|
|
2024-01-03 20:06:53 +07:00
|
|
|
import
|
|
|
|
../../json_rpc/router
|
|
|
|
|
2024-01-04 07:49:19 +07:00
|
|
|
converter toStr*(value: distinct (string|JsonString)): string = string(value)
|
2024-01-03 20:06:53 +07:00
|
|
|
|
2024-01-04 07:49:19 +07:00
|
|
|
template `==`*(a: JsonString, b: JsonNode): bool =
|
2024-01-03 20:06:53 +07:00
|
|
|
parseJson(string a) == b
|
|
|
|
|
2024-01-04 07:49:19 +07:00
|
|
|
template `==`*(a: JsonNode, b: JsonString): bool =
|
2024-01-03 20:06:53 +07:00
|
|
|
a == parseJson(string b)
|