Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
f4b32f650c |
@ -476,9 +476,12 @@ impl<F: Flavour> Compile for TypeScriptCompiler<F> {
|
|||||||
for field in definition.fields.iter() {
|
for field in definition.fields.iter() {
|
||||||
let typ = Self::type_to_typescript_ext(&field.typ);
|
let typ = Self::type_to_typescript_ext(&field.typ);
|
||||||
|
|
||||||
|
let opt = if field.typ.is_optional() { "?" } else { "" };
|
||||||
|
|
||||||
f.a1(format!(
|
f.a1(format!(
|
||||||
"public {}: {};",
|
"public {}{}: {};",
|
||||||
Self::fix_keyword_name(&field.name),
|
Self::fix_keyword_name(&field.name),
|
||||||
|
opt,
|
||||||
typ
|
typ
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user