Skip to content

Commit 4ee6953

Browse files
committed
ts
1 parent 9044327 commit 4ee6953

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/format/src/se.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ export function formatPhoneNumber(input: string): string {
4545
}
4646

4747
const subscriberNumberFormat =
48-
SUBSCRIBER_NUMBER_FORMATS[subscriberNumber.length];
48+
SUBSCRIBER_NUMBER_FORMATS[
49+
// the cast should be okay here, as we've checked the length above
50+
subscriberNumber.length as keyof typeof SUBSCRIBER_NUMBER_FORMATS
51+
];
4952

5053
const replacePattern = subscriberNumber.length === 5 ? '$1 $2' : '$1 $2 $3';
5154

0 commit comments

Comments
 (0)