Add copyright year to source file

This commit is contained in:
jangko 2023-12-13 16:07:57 +07:00
parent 9b5fbf8a0c
commit 34dc825066
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
18 changed files with 169 additions and 5 deletions

View File

@ -1,3 +1,12 @@
# json-serialization
# Copyright (c) 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.
# begin Nimble config (version 1) # begin Nimble config (version 1)
when fileExists("nimble.paths"): when fileExists("nimble.paths"):
include "nimble.paths" include "nimble.paths"

View File

@ -1,3 +1,12 @@
# json-serialization
# Copyright (c) 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.
import import
serialization, json_serialization/[format, reader, writer] serialization, json_serialization/[format, reader, writer]

View File

@ -1,3 +1,12 @@
# 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.
import import
serialization/formats serialization/formats

View File

@ -1,4 +1,11 @@
{.push raises: [].} # 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.
import import
std/[json, unicode], std/[json, unicode],

View File

@ -1,3 +1,12 @@
# 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.
{.experimental: "notnil".} {.experimental: "notnil".}
import import

View File

@ -1,3 +1,12 @@
# 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.
import import
std/strutils, stew/shims/net, std/strutils, stew/shims/net,
../../json_serialization, chronos/transports/common ../../json_serialization, chronos/transports/common

View File

@ -1,3 +1,12 @@
# 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.
import std/options, ../../json_serialization/[reader, writer, lexer] import std/options, ../../json_serialization/[reader, writer, lexer]
export options export options

View File

@ -1,3 +1,12 @@
# 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.
import stew/shims/sets, ../../json_serialization/[reader, writer, lexer] import stew/shims/sets, ../../json_serialization/[reader, writer, lexer]
export sets export sets

View File

@ -1,3 +1,12 @@
# 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.
import stew/shims/tables, ../../json_serialization/[reader, writer, lexer] import stew/shims/tables, ../../json_serialization/[reader, writer, lexer]
export tables export tables

View File

@ -1,3 +1,12 @@
# 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.
import import
stew/results, ../../json_serialization/[reader, writer, lexer] stew/results, ../../json_serialization/[reader, writer, lexer]

View File

@ -1,3 +1,12 @@
# 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.
import import
serialization/errors serialization/errors

View File

@ -1,3 +1,12 @@
# 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.
import import
std/[json, typetraits], std/[json, typetraits],
faststreams/[outputs, textio], serialization, faststreams/[outputs, textio], serialization,
@ -152,6 +161,9 @@ template writeObjectField*[FieldType, RecordType](w: var JsonWriter,
field: FieldType): bool = field: FieldType): bool =
mixin writeFieldIMPL, writeValue mixin writeFieldIMPL, writeValue
type
R {.used.} = type record
w.writeFieldName(fieldName) w.writeFieldName(fieldName)
when RecordType is tuple: when RecordType is tuple:
w.writeValue(field) w.writeValue(field)

View File

@ -1,2 +1,11 @@
# 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.
--threads:on --threads:on

View File

@ -1,3 +1,14 @@
# 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.
{. warning[UnusedImport]:off .}
import import
test_lexer, test_lexer,
test_serialization test_serialization

View File

@ -1,3 +1,12 @@
# 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.
import import
strutils, strutils,
serialization, serialization,

View File

@ -1,4 +1,11 @@
{.used.} # 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.
import import
unittest, unittest,

View File

@ -1,4 +1,11 @@
{.used.} # 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.
import import
strutils, unittest2, json, strutils, unittest2, json,
@ -746,6 +753,7 @@ suite "toJson tests":
expect SerializationError: expect SerializationError:
let h4 = Json.decode("""{"o":{"distance":3,"x":1,"y":"2"}}""", let h4 = Json.decode("""{"o":{"distance":3,"x":1,"y":"2"}}""",
HoldsOption, requireAllFields = true) HoldsOption, requireAllFields = true)
discard h4
test "Nested option types": test "Nested option types":
let let
@ -824,6 +832,7 @@ suite "toJson tests":
expect SerializationError: expect SerializationError:
let h4 = Json.decode("""{"o":{"distance":3,"x":1,"y":"2"}}""", let h4 = Json.decode("""{"o":{"distance":3,"x":1,"y":"2"}}""",
HoldsResultOpt, requireAllFields = true) HoldsResultOpt, requireAllFields = true)
discard h4
test "Custom field serialization": test "Custom field serialization":
let obj = WithCustomFieldRule(str: "test", intVal: 10) let obj = WithCustomFieldRule(str: "test", intVal: 10)

View File

@ -1,4 +1,14 @@
import strutils # 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.
import
strutils
# `dedent` exists in newer Nim version and doesn't behave the same # `dedent` exists in newer Nim version and doesn't behave the same
func test_dedent*(s: string): string = func test_dedent*(s: string): string =