Try Install Learn Blog API Packages GitHub
Pages

Object.Decode

Functions for decoding specific types from an Object.

Functions

array
(
decoder
:
Function(Object, Result(Object.Error, a))
input
:
Object
)
:
Result(Object.Error, Array(a))

Decodes the object as a Array using the given decoder.

boolean
(
input
:
Object
)
:
Result(Object.Error, Bool)

Decodes the object as a Bool

field
(
key
:
String
decoder
:
Function(Object, Result(Object.Error, a))
input
:
Object
)
:
Result(Object.Error, a)

Decodes an field from an object using the given decoder.

maybe
(
decoder
:
Function(Object, Result(Object.Error, a))
input
:
Object
)
:
Result(Object.Error, Maybe(a))

Decodes the object as a Maybe(a) using the given decoder.

number
(
input
:
Object
)
:
Result(Object.Error, Number)

Decodes the object as a Number

string
(
input
:
Object
)
:
Result(Object.Error, String)

Decodes the object as a String

time
(
input
:
Object
)
:
Result(Object.Error, Time)

Decodes the object as a Time