Skip to content

Commit af97012

Browse files
committed
cleanup
1 parent 394452a commit af97012

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/common/src/util/splitKey.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
import type { HatStyleName } from "../ide/types/hatStyles.types";
22

3-
export function splitKey(key: string) {
3+
interface SplitKey {
4+
hatStyle: string;
5+
// If the character is `.` then it will appear as a zero length string
6+
// due to the way the split on `.` works
7+
character: HatStyleName;
8+
}
9+
10+
export function splitKey(key: string): SplitKey {
411
const [hatStyle, character] = key.split(".");
512

613
return {
7-
hatStyle: hatStyle,
14+
hatStyle,
815
// If the character is `.` then it will appear as a zero length string
916
// due to the way the split on `.` works
1017
character: character.length === 0 ? "." : character,

0 commit comments

Comments
 (0)