Class: DefSelect

algeobra~DefSelect(key)

Select some key from a value and optionally transform it. If the value does not exist, the definition is INVALID Can be used to easily get elements of an array or some other storage where more information is bundled

Constructor

new DefSelect(key)

Parameters:
Name Type Description
key * The key to select
Source:

Methods

compute(createInfo) → {*}

Computes the key selection
Parameters:
Name Type Description
createInfo CreateInfo The creation info
Source:
Returns:
The value of the key or transformed object
Type
*

(static) fromObject(obj, transformopt) → {CreateInfo}

Select the key from a given object and optionally transforms it
Parameters:
Name Type Attributes Default Description
obj Number | Object Either the index or value of an object
transform function <optional>
null Function to transform the aquired key
Source:
Returns:
The creation info
Type
CreateInfo