Skip to content

Commit

Permalink
Support optionnal operator
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGruber committed Jan 30, 2024
1 parent fedef69 commit ca06981
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/act_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ pub fn get_param_type_ann(param: &Param) -> Result<Box<TsType>, String> {
},
kind: TsKeywordTypeKind::TsUnknownKeyword,
}));

if param_pat.is_ident() {
let param_ident = param_pat.ident().unwrap();
if param_ident.optional {
// If is optionnal, we skip it
return Ok(param_type_ann);
}
if param_ident.type_ann.is_none() {
return Err(String::from("param_ident.type_ann.is_none()"));
}
Expand Down

0 comments on commit ca06981

Please sign in to comment.