File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -539,15 +539,11 @@ function advParseArgs<TArgsDef extends readonly ArgDef[]>(
539539 . map ( ( arg ) => {
540540 const optionConfig = {
541541 type : arg . boolean ? ( "boolean" as const ) : ( "string" as const ) ,
542- short : arg . short ,
543- default : typeof arg . default === "function" ? arg . default ( ) : arg . default ,
542+ ...( arg . short && { short : arg . short } ) ,
543+ ...( arg . default !== undefined && {
544+ default : typeof arg . default === "function" ? arg . default ( ) : arg . default ,
545+ } ) ,
544546 } ;
545- if ( arg . short ) {
546- optionConfig . short = arg . short ;
547- }
548- if ( arg . default !== undefined ) {
549- optionConfig . default = typeof arg . default === "function" ? arg . default ( ) : arg . default ;
550- }
551547 return [ arg . name , optionConfig ] ;
552548 } )
553549 ) ,
You can’t perform that action at this time.
0 commit comments