From aef841884bf3ebdd562a755179a60f5ca415381c Mon Sep 17 00:00:00 2001 From: quentingruber Date: Tue, 30 Jan 2024 23:31:45 +0100 Subject: [PATCH] Support optionnal operator --- src/act_process.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/act_process.rs b/src/act_process.rs index 8b50491..2ea450f 100644 --- a/src/act_process.rs +++ b/src/act_process.rs @@ -37,9 +37,12 @@ pub fn get_param_type_ann(param: &Param) -> Result, 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()")); }