Nullable ts fields
This commit is contained in:
parent
ea88a84e5d
commit
c02c95344c
5 changed files with 18 additions and 15 deletions
|
@ -1,3 +1,6 @@
|
|||
# 2.0.4
|
||||
* Fields in TypeScript definitions are now nullable by default.
|
||||
|
||||
# 2.0.3
|
||||
* Added a `TypeScriptDefinitionBuilder`.
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ class TypeScriptDefinitionBuilder implements Builder {
|
|||
field.name, field.type, ext, buildStep);
|
||||
|
||||
// foo: string;
|
||||
buf.writeln('$alias: $typeScriptType;');
|
||||
buf.writeln('$alias?: $typeScriptType;');
|
||||
}
|
||||
|
||||
buf
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: angel_serialize_generator
|
||||
version: 2.0.3
|
||||
version: 2.0.4
|
||||
description: Model serialization generators, designed for use with Angel. Combine with angel_serialize for flexible modeling.
|
||||
author: Tobe O <thosakwe@gmail.com>
|
||||
homepage: https://github.com/angel-dart/serialize
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
interface Library {
|
||||
id: string;
|
||||
collection: BookCollection;
|
||||
created_at: any;
|
||||
updated_at: any;
|
||||
id?: string;
|
||||
collection?: BookCollection;
|
||||
created_at?: any;
|
||||
updated_at?: any;
|
||||
}
|
||||
interface BookCollection {
|
||||
[key: string]: Book;
|
||||
|
|
18
angel_serialize_generator/test/models/book.d.ts
vendored
18
angel_serialize_generator/test/models/book.d.ts
vendored
|
@ -1,12 +1,12 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
interface Book {
|
||||
id: string;
|
||||
author: string;
|
||||
title: string;
|
||||
description: string;
|
||||
page_count: number;
|
||||
not_models: any[];
|
||||
camelCase: string;
|
||||
created_at: any;
|
||||
updated_at: any;
|
||||
id?: string;
|
||||
author?: string;
|
||||
title?: string;
|
||||
description?: string;
|
||||
page_count?: number;
|
||||
not_models?: any[];
|
||||
camelCase?: string;
|
||||
created_at?: any;
|
||||
updated_at?: any;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue