Changelog
0.7.0 (Jun 25, 2019)
relude
and bs-abstract
are now peerDependencies. This means you'll need to add these dependencies to your own package.json
, and you're much less likely to end up with duplicate versions of these packages.Changelog
0.6.2 (Jun 7, 2019)
Decode.array
(and its friend list
) had a regression where they could fail in some browsers when given large amounts of data, but stack safety has been restoredChangelog
0.6.0 (May 27, 2019)
Decode.fallback
doesn't assume you want to work with field
s, but you can use Decode.(fallback(field("x", string), "default"))
if you want the old behaviorDecode.Pipeline.fallback
has the same new behavior, but it provides fallbackField
to achieve the old behaviorDecode.ParseError.map
has been removed (it wasn't used internally or documented)Decode.ParseError
variant type now includes a TriedMultiple
constructor. This is only a breaking change if you are matching directly on values of this type.Decode.AsResult.OfStringNel
actually collects multiple errors nowDecode.alt
allows combining decode functions and picking the first successDecode.AsResult.OfStringNel
now includes all of the same map
, flatMap
, etc functions for decodersDecode.ParseError
is aliased as Decode.AsResult.OfParseError.ParseError
so parse errors can be accessed from an aliased decode moduleDecode_AsOption
tests decoders pass-vs-fail, Decode_AsResult_*
tests failure reportingmap
, flatMap
, alt
, etc on the decoders themselves, rather than running the decoders and transforming the outputJs.Dict.key
was changed to string
in interface files for better editor suggestionsChangelog
0.5.1 (May 22, 2019)
Changelog
0.5.0 (May 13, 2019)
Decode.oneOf
now takes a single decoder, followed by a list of decoders instead of requiring you to construct a NonEmptyList
(#28)Decode.ok
has been removed; if you want to construct a decoder that always succeeds (ignoring the JSON input), use Decode.pure
insteadNonEmptyList
s of errors now use Relude.NonEmpty.List
instead of the implementation from bs-nonempty
due to more active maintenance and a broader collection of helper functionsDecode.ResultUtils
is no longer part of the public interface. Decode functions themselves are more easily composable (see "New stuff" below), so there's less need to transform the output after decoding. Plus better libraries exist if you want to work with option
and result
types. (#33)map
, apply
, map2
...map5
, and flatMap
functions, meaning you can transform decoders before actually running them. (#23)Decode.NonEmptyList
is exposed for all decode modules that return a NonEmptyList
of errors. This means you can do basic operations with the errors without bringing in an additional library (#24)Decode.Pipeline
aliases most of the base decoders (e.g. string
, intFromNumber
, etc), so locally-opening Decode.Pipeline
should get you everything you need (#27)Changelog
0.4.0 (Jan 24, 2019)
float
and int
are now floatFromNumber
and intFromNumber
to avoid compiler warnings related to shadowing Pervasives.float
Decode.date
decodes numbers or ISO-8601 strings into Js.Date.t
Decode.oneOf
attempts multiple decodersDecode.dict
decodes an object into a Js.Dict.t
Decode.variantFromJson
(and variantFromString
, variantFromInt
) decode JSON values directly into Reason variantsDecode.Pipeline.at
now brings at
functionality into the pipeline, to allow digging into nested JSON objectsdocs/
folder has more content