Releases: joanllenas/ts.data.json
Releases · joanllenas/ts.data.json
v1.1.0
v1.0.1
v1.0.0
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
v0.2.1
Features
- decoders: Added new objectStrict decoder (2365be6)
This should have been a minor release instead of a path release. Sorry.
v0.2.0
v0.1.0
Feature
- allOf: add allOf decoder