2023-12-13 09:07:57 +00:00
|
|
|
# json-serialization
|
|
|
|
# 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.
|
|
|
|
|
2019-03-19 23:54:03 +00:00
|
|
|
import
|
|
|
|
serialization/errors
|
|
|
|
|
|
|
|
export
|
|
|
|
errors
|
|
|
|
|
2019-01-21 17:40:14 +00:00
|
|
|
type
|
|
|
|
JsonMode* = enum
|
|
|
|
Relaxed
|
|
|
|
Portable
|
|
|
|
|
2019-03-19 23:54:03 +00:00
|
|
|
JsonError* = object of SerializationError
|
2019-01-21 17:40:14 +00:00
|
|
|
|
2020-06-01 18:15:22 +00:00
|
|
|
JsonString* = distinct string
|
|
|
|
|
2019-01-21 17:40:14 +00:00
|
|
|
const
|
|
|
|
defaultJsonMode* = JsonMode.Relaxed
|
|
|
|
minPortableInt* = -9007199254740991 # -2**53 + 1
|
|
|
|
maxPortableInt* = 9007199254740991 # +2**53 - 1
|
|
|
|
|
2020-07-17 20:58:02 +00:00
|
|
|
template `==`*(lhs, rhs: JsonString): bool =
|
|
|
|
string(lhs) == string(rhs)
|