Swiftpack.co - dduan/TOMLDecoder as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by dduan.
dduan/TOMLDecoder 0.2.2
From TOML to Swift Codable types.
⭐️ 52
🕓 6 weeks ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/dduan/TOMLDecoder.git", from: "0.2.2")

TOMLDecoder

Amazon Linux 2
CentOS 7
macOS
Ubuntu Bionic
Ubuntu Focal
Windows

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.2")

License

MIT. See LICENSE.md.

GitHub

link
Stars: 52
Last commit: 6 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Related Packages

Release Notes

0.2.1
1 year ago
  • 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.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics