( methods: Methods, )
| 21 | }>; |
| 22 | type _Id<T> = T extends infer U ? { [K in keyof U]: U[K] } : never; |
| 23 | const defineEffectedFunctions = <Methods extends EffectedMethods>( |
| 24 | methods: Methods, |
| 25 | ): TransformEffectedMethods<Methods> => { |
| 26 | const transform = (methods: any): any => |
| 27 | Object.fromEntries( |
| 28 | Object.entries(methods).map(([name, fnOrMethods]) => [ |
| 29 | name, |
| 30 | typeof fnOrMethods === "function" ? |
| 31 | (...args: any) => effected(() => fnOrMethods(...args)) |
| 32 | : transform(fnOrMethods), |
| 33 | ]), |
| 34 | ); |
| 35 | return transform(methods); |
| 36 | }; |
| 37 | |
| 38 | const defineRepository = defineEffectedFunctions; |
| 39 | const defineService = defineEffectedFunctions; |
nothing calls this directly
no test coverage detected