Skip to content

Commit 759ccda

Browse files
committed
chore: improve type safe
1 parent e419c6f commit 759ccda

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

shared/const.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
export const STORAGE_KEY_LOCALE = 'local:locale'
2-
export const STORAGE_KEY_FEATURE_PREFIX = 'local:feature:' as const
3-
export const STORAGE_KEY_SKIP_INTL_ALERT = 'local:skipIntlAlert'
1+
export const STORAGE_KEY_LOCALE = (<const>'local:locale') satisfies StorageItemKey
2+
export const STORAGE_KEY_SKIP_INTL_ALERT = (<const>'local:skipIntlAlert') satisfies StorageItemKey
43

54
export const FEATURE_GROUPS = [
65
{

shared/feature.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
export const STORAGE_KEY_FEATURE_PREFIX = (<const>'local:feature:') satisfies StorageItemKey
2+
13
export const getFeatureStorageKey = (featureKey: FeatureKey) =>
24
`${STORAGE_KEY_FEATURE_PREFIX}${featureKey}` as const
35

0 commit comments

Comments
 (0)