feat: add util
This commit is contained in:
parent
e7d933e6e9
commit
ee94bda295
@ -1,2 +1,2 @@
|
||||
|
||||
export * from './utils'
|
||||
export * from './enums'
|
||||
|
||||
3
src/lib/utils/convert-enum.util.ts
Normal file
3
src/lib/utils/convert-enum.util.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export function convertEnum<T extends object>(target: T, value: string): T[keyof T] {
|
||||
return (target as any)[value]
|
||||
}
|
||||
1
src/lib/utils/index.ts
Normal file
1
src/lib/utils/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './convert-enum.util'
|
||||
Loading…
x
Reference in New Issue
Block a user