diff --git a/gleam.toml b/gleam.toml index 2052573..b44d943 100644 --- a/gleam.toml +++ b/gleam.toml @@ -11,7 +11,7 @@ description = "A package for keeping your encoders and decoders in sync." [dependencies] gleam_stdlib = "~> 0.31" -gleam_json = "~> 1.0" +gleam_json = ">= 2.0.0 and < 3.0.0" [dev-dependencies] gleeunit = "~> 1.0" diff --git a/manifest.toml b/manifest.toml index bfa9868..bf12adb 100644 --- a/manifest.toml +++ b/manifest.toml @@ -2,13 +2,12 @@ # You typically do not need to edit this file packages = [ - { name = "gleam_json", version = "0.7.0", build_tools = ["gleam"], requirements = ["thoas", "gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "CB405BD93A8828BCD870463DE29375E7B2D252D9D124C109E5B618AAC00B86FC" }, - { name = "gleam_stdlib", version = "0.35.1", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "5443EEB74708454B65650FEBBB1EF5175057D1DEC62AEA9D7C6D96F41DA79152" }, - { name = "gleeunit", version = "1.0.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "D364C87AFEB26BDB4FB8A5ABDE67D635DC9FA52D6AB68416044C35B096C6882D" }, - { name = "thoas", version = "0.4.1", build_tools = ["rebar3"], requirements = [], otp_app = "thoas", source = "hex", outer_checksum = "4918D50026C073C4AB1388437132C77A6F6F7C8AC43C60C13758CC0ADCE2134E" }, + { name = "gleam_json", version = "2.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "0A57FB5666E695FD2BEE74C0428A98B0FC11A395D2C7B4CDF5E22C5DD32C74C6" }, + { name = "gleam_stdlib", version = "0.49.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "A7DB09F15738198A87255425FBCE049B4B84C77CC522786DC923DABA73911F13" }, + { name = "gleeunit", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "F7A7228925D3EE7D0813C922E062BFD6D7E9310F0BEE585D3A42F3307E3CFD13" }, ] [requirements] -gleam_json = { version = "~> 0.5" } +gleam_json = { version = ">= 2.0.0 and < 3.0.0" } gleam_stdlib = { version = "~> 0.31" } gleeunit = { version = "~> 1.0" } diff --git a/src/gleam_community/codec.gleam b/src/gleam_community/codec.gleam index 87b67d3..df40561 100644 --- a/src/gleam_community/codec.gleam +++ b/src/gleam_community/codec.gleam @@ -1,17 +1,17 @@ // IMPORTS --------------------------------------------------------------------- +import gleam/dict.{type Dict} import gleam/dynamic.{ type DecodeError as DynamicError, type Dynamic, DecodeError as DynamicError, } import gleam/function +import gleam/int import gleam/json.{type DecodeError as JsonError, type Json} import gleam/list -import gleam/dict.{type Dict} import gleam/option.{type Option} import gleam/pair import gleam/result -import gleam/string_builder.{type StringBuilder} -import gleam/int +import gleam/string_tree.{type StringTree} // TYPES ----------------------------------------------------------------------- @@ -567,7 +567,7 @@ pub fn encode_string(value: a, codec: Codec(a)) -> String { /// /// -pub fn encode_string_custom_from(value: a, codec: Codec(a)) -> StringBuilder { +pub fn encode_string_custom_from(value: a, codec: Codec(a)) -> StringTree { codec.encode(value) |> json.to_string_builder }