Skip to content

Commit

Permalink
Fixed character length bug
Browse files Browse the repository at this point in the history
  • Loading branch information
minagishl committed Jul 26, 2024
1 parent d6f6ccf commit eaa917d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ function transformName(
): string {
if (name.includes('+')) {
const parts = name.split('+');
let combinedName = parts[0].slice(0, 1) + parts[1].slice(0, length - 1);
const newLength = length === 1 ? 0 : length - 1;
let combinedName = parts[0].slice(0, 1) + parts[1].slice(0, newLength);
return uppercase ? combinedName.toUpperCase() : combinedName;
} else {
return uppercase
Expand Down

0 comments on commit eaa917d

Please sign in to comment.