Compare commits

..

No commits in common. "050cef92e40d9fc949bd19a027180eee3d673748" and "aed9b6413f01f2acda5e2f184ba51d5129794f38" have entirely different histories.

3 changed files with 3 additions and 13 deletions

View file

@ -1,5 +1,5 @@
name = "spacetraders_sdk"
version = "1.5.5"
version = "1.5.4"
gleam = ">= 1.11.0"
description = "A Gleam SDK for the spacetraders.io game API"
licences = ["MIT"]

View file

@ -1,5 +1,4 @@
import gleam/dynamic/decode.{type Decoder}
import gleam/int
import gleam/json.{type Json}
pub opaque type ShipComponentCondition {
@ -18,11 +17,7 @@ pub fn parse(value: Float) -> Result(ShipComponentCondition, Nil) {
}
pub fn decoder() -> Decoder(ShipComponentCondition) {
use value <- decode.then(
decode.one_of(decode.float, [
decode.then(decode.int, fn(i) { decode.success(int.to_float(i)) }),
]),
)
use value <- decode.then(decode.float)
case parse(value) {
Ok(ship_component_condition) -> decode.success(ship_component_condition)
Error(Nil) ->

View file

@ -1,5 +1,4 @@
import gleam/dynamic/decode.{type Decoder}
import gleam/int
import gleam/json.{type Json}
pub opaque type ShipComponentIntegrity {
@ -18,11 +17,7 @@ pub fn parse(value: Float) -> Result(ShipComponentIntegrity, Nil) {
}
pub fn decoder() -> Decoder(ShipComponentIntegrity) {
use value <- decode.then(
decode.one_of(decode.float, [
decode.then(decode.int, fn(i) { decode.success(int.to_float(i)) }),
]),
)
use value <- decode.then(decode.float)
case parse(value) {
Ok(ship_component_integrity) -> decode.success(ship_component_integrity)
Error(Nil) ->