Skip to content

Releases: joanllenas/ts.data.json

v1.1.0

23 Feb 18:32
Compare
Choose a tag to compare

Features:

  • Added new nullable decoder - (docs)

v1.0.1

29 Jan 11:22
Compare
Choose a tag to compare
  • Eliminated instanceof checks against classes defined within the library - pull/16

v1.0.0

18 Dec 19:33
Compare
Choose a tag to compare

Breaking

JsonDecoder.object now requires to specify decoders even for the optional (i.e. with {name?: string}) fields. You'll notice because the compiler will warn you.

If this affects you and you don't want to change the current behaviour of your decoder, you can migrate your existing decoders by adding optionalKey: JsonDecoder.succeed.
An example:

interface User {
  name: string;
  dob?: string;
}

const decoder = JsonDecoder.object<User>(
  {
    name: JsonDecoder.string,
    dob: JsonDecoder.succeed
  },
  "User"
);

console.log(decoder.decode({name: 'Rick', dob: '2000-12-18T19:28:59.387Z'})); // Ok, dob is 2000-12-18T19:28:59.387Z
console.log(decoder.decode({name: 'Rick'})); // Ok, `dob` is undefined

v0.3.0

07 Oct 02:17
Compare
Choose a tag to compare

Features

v0.2.1

01 Sep 16:30
Compare
Choose a tag to compare

Features

This should have been a minor release instead of a path release. Sorry.

v0.2.0

01 Sep 16:28
Compare
Choose a tag to compare

Features

  • Result: Result is a Functor now (356c3b0)

v0.1.0

06 May 08:35
Compare
Choose a tag to compare

Feature

  • allOf: add allOf decoder