(type: N | string)
| 14 | export type TypeNames = (typeof supportedTypes)[keyof typeof supportedTypes]['name']; |
| 15 | |
| 16 | export function getTypeByScalarName< |
| 17 | T extends keyof TypeNameMap, |
| 18 | R extends TypeNameMap[T]['hashCodeArg'], |
| 19 | N extends TypeNameMap[T]['name'], |
| 20 | >(type: N | string): TypeClass<N, R> | undefined { |
| 21 | const typeClass = Object.values(supportedTypes).find(({name}) => name === type); |
| 22 | if (!typeClass) return undefined; |
| 23 | |
| 24 | return typeClass as TypeClass<N, R>; |
| 25 | } |
no test coverage detected