TOMLDecoder

0.2.1

From TOML to Swift Codable types.
dduan/TOMLDecoder

What's New

0.2.1

2021-01-18T07:34:08Z
  • Include a new type DeserializationError. It contains information regarding
    deserialization.
  • Improve error reporting. After encountering one error, the parser will
    disgard characters until new line, and attempt to parse another top-level
    expression. This is more determinastic compared to previous recovery attempts.
  • Add more specific errors regarding missing pices at closing position. For
    example, string missing closing quotes, or table missing closing bracket.
    These errors will cause the parser to report detailed error message.
  • Fix a bug where newline characters sometimes are considered valid as part of
    basic string content.

TOMLDecoder

Swift 5.3 & 5.3.1
Amazon Linux 2
CentOS 8
macOS 11.15
Ubuntu Bionic
Ubuntu Focal

TOML parser for your Swift Codables.

struct Team: Codable {
    struct Player: Codable {
        let id: String
        let health: Int
        let joinDate: Date
    }

    let players: [Player]
}

let team = try TOMLDecoder().decode(Team.self, from: tomlData)

TOMLDecoder has a relatively simple set of APIs. Learn more in the introduction.

Installation

With SwiftPM

.package(url: "https://github.com/dduan/TOMLDecoder", from: "0.2.1")

License

MIT. See LICENSE.md.

Description

  • Swift Tools 5.0.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri Oct 15 2021 18:04:15 GMT-0500 (GMT-05:00)