( functionName: string, signatureType: SignatureType, userFunction: HandlerFunction<T>, )
| 35 | * Helper method to store a registered function in the registration container |
| 36 | */ |
| 37 | const register = <T = unknown, U = unknown>( |
| 38 | functionName: string, |
| 39 | signatureType: SignatureType, |
| 40 | userFunction: HandlerFunction<T>, |
| 41 | ): void => { |
| 42 | if (!isValidFunctionName(functionName)) { |
| 43 | throw new Error(`Invalid function name: ${functionName}`); |
| 44 | } |
| 45 | |
| 46 | registrationContainer.set(functionName, { |
| 47 | signatureType, |
| 48 | userFunction, |
| 49 | }); |
| 50 | }; |
| 51 | |
| 52 | /** |
| 53 | * Returns true if the function name is valid |
no test coverage detected