Skip to content

Commit

Permalink
use token_decorated_with_space
Browse files Browse the repository at this point in the history
  • Loading branch information
minht11 committed Apr 28, 2024
1 parent 0683433 commit f49c4f5
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use biome_console::markup;
use biome_diagnostics::Applicability;
use biome_js_factory::make;
use biome_js_syntax::{
AnyTsType, JsSyntaxKind, JsSyntaxToken, TriviaPieceKind, TsReferenceType, TsTypeArguments, T,
AnyTsType, JsSyntaxKind, JsSyntaxToken, TsReferenceType, TsTypeArguments, T,
};
use biome_rowan::{AstNode, AstSeparatedList, BatchMutationExt, TriviaPiece};

Expand Down Expand Up @@ -236,11 +236,7 @@ fn convert_to_array_type(
length => {
let ts_union_type_builder = make::ts_union_type(make::ts_union_type_variant_list(
types_array,
(0..length - 1).map(|_| {
make::token(T![|])
.with_leading_trivia([(TriviaPieceKind::Whitespace, " ")])
.with_trailing_trivia([(TriviaPieceKind::Whitespace, " ")])
}),
(0..length - 1).map(|_| make::token_decorated_with_space(T![|])),
));
return Some(AnyTsType::TsUnionType(ts_union_type_builder.build()));
}
Expand Down

0 comments on commit f49c4f5

Please sign in to comment.