Skip to content

Commit

Permalink
review-fix:convertHyphenatedZipCode関数を外部へ切り出し
Browse files Browse the repository at this point in the history
  • Loading branch information
marumoto-goq committed May 2, 2024
1 parent eae2236 commit 9a33c30
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/utils/convertHyphenatedZipCode.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { HyphenatedZipCode } from '../type/type';

export const convertHyphenatedZipCode = (
zipCode: string | HyphenatedZipCode
): HyphenatedZipCode | string => {
return `${zipCode.slice(0, 3)}-${zipCode.slice(3)}`;
};

0 comments on commit 9a33c30

Please sign in to comment.