We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 36de430 commit 87954e5Copy full SHA for 87954e5
‎packages/core/src/internal/tag.ts
@@ -1,5 +1,3 @@
1
-const TAG = '@sirutils/core' as const
+import { tagBuilder } from '../utils/tags'
2
3
-export const createTag = <const T>(str: T) => `${TAG}.${str}` as TagMapper<T>
4
-
5
-export type TagMapper<T> = T extends string ? `${typeof TAG}.${T}` : null
+export const createTag = tagBuilder('@sirutils/core')
‎packages/core/src/utils/tags.ts
@@ -0,0 +1,5 @@
+export const tagBuilder = <const T>(tag: T) => {
+ return <const S>(str: S) => `${tag}.${str}` as TagMapper<S, T>
+}
+
+export type TagMapper<S, T> = T extends string ? (S extends string ? `${T}.${S}` : null) : null
0 commit comments