Compare commits
2 Commits
e7d933e6e9
...
f0bad1ed7f
| Author | SHA1 | Date | |
|---|---|---|---|
| f0bad1ed7f | |||
| ee94bda295 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@teacinema/common",
|
"name": "@teacinema/common",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "Common library for TeaCinema microservices",
|
"description": "Common library for TeaCinema microservices",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
|
export * from './utils'
|
||||||
export * from './enums'
|
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