Function Utils

Methods

# (inner) isValidConnection(typeA, typeB) → {Boolean}

Returns if the types of two slots are compatible (taking into account wildcards, etc)
Parameters:
Name Type Description
typeA String
typeB String
Returns:
true if they can be connected
Type
Boolean

# (inner) wrapFunctionAsNode(name, func, paramType, returnType, properties)

Create a new nodetype by passing a function, it wraps it with a proper class and generates inputs according to the parameters of the function. Useful to wrap simple methods that do not require properties, and that only process some input to generate an output.
Parameters:
Name Type Description
name String node name with namespace (p.e.: 'math/sum')
func function
paramType Array [optional] an array containing the type of every parameter, otherwise parameters will accept any type
returnType String [optional] string with the return type, otherwise it will be generic
properties Object [optional] properties to be configurable