%dw 2.0
output application/json
import * from dw::core::Types
type AFunction = (String, Number) -> Number
type AFunction2 = () -> Number
---
{
a: functionParamTypes(AFunction),
b: functionParamTypes(AFunction2)
}
functionParamTypes
functionParamTypes(t: Type): Array<FunctionParam>
Returns the list of parameters from the given function type. This function fails if the provided type is not a Function type.
Introduced in DataWeave version 2.3.0.
Example
This example shows how functionParamTypes
behaves with different inputs.