Skip to content

Releases: joanllenas/ts.data.json

v2.2.0

24 Sep 11:11
Compare
Choose a tag to compare

Features

  • Added a new decoder for empty objects JsonDecoder.emptyObject (fixes #34) (docs)

Example:

JsonDecoder.emptyObject.decode({}); // Ok<{}>({value: {}})
JsonDecoder.emptyObject.decode({ a: 1 }); // Err({error: '{a:1} is not a valid empty object'})

v2.1.1

27 Jun 15:50
Compare
Choose a tag to compare

This release contains a bug fix contributed by @mlocati 🎉

v2.1.0

23 Oct 21:43
Compare
Choose a tag to compare

Feature

  • Added FromDecoder<D> to infer types from decoder declarations. (docs)

Without FromDecoder

type User = {
  firstname: string;
  lastname: string;
};

const userDecoder = JsonDecoder.object<User>(
  {
    firstname: JsonDecoder.string,
    lastname: JsonDecoder.string
  },
  'User'
);

With FromDecoder

const userDecoder = JsonDecoder.object(
  {
    firstname: JsonDecoder.string,
    lastname: JsonDecoder.string
  },
  'User'
);
type User = FromDecoder<typeof userDecoder>;

v2.0.0

19 May 08:59
Compare
Choose a tag to compare

In this release

  • Removed deprecated APIs:
Before After
onDecode() fold()
decodePromise() decodeToPromise()
then() chain()

BREAKING CHANGES

  • onDecode() is now fold().
  • decodePromise() is now decodeToPromise().
  • then() is now chain().
  • Upgraded to TypeScript v4

v1.7.0

18 Mar 20:55
Compare
Choose a tag to compare

In this release

Before After
onDecode() fold()
decodePromise() decodeToPromise()
then() chain()

v1.6.1

02 Mar 10:34
Compare
Choose a tag to compare

Added CJS and ESM builds.

v1.5.0

29 Oct 17:07
Compare
Choose a tag to compare

Features

  • Added new tuple decoder.

🎉 PR #28 contributed by Richard A Hofer.

v1.4.0

12 Oct 09:48
Compare
Choose a tag to compare

Feature

  • Added new mapError Decoder transformer.

🎉 PR (#26) contributed by user knutbekk

v1.3.0

24 Sep 09:48
f61ddb5
Compare
Choose a tag to compare

Features

  • Added the new JsonDecoder.enumeration() decoder (docs)

🎉 Contributed by Richard A Hofer

v1.2.0

28 Jul 20:59
Compare
Choose a tag to compare

Features

  • Added the new JsonDecoder.combine() decoder (docs)

🎉 Contributed by Aleksandr Borovykh