API∞
The module exports two functions cook amd partial. The latter only to create specializations of the cooking.
cook∞
Derive an array of objects from pairs that map population samples to distinct features.
The default (but optional) validation ensures:
- population and pairs both are non-empty arrays of non-null values
- features are unique (first elements of pairs)
- pairs second entries only provide members of population
Parameters∞
populationarray array with all members of the population.samplestring key mapping to the sample from the population.featurestring key mapping to the feature variations.pairsarray pairs of features and array of samples (null for final pair).forcebool (false does / true does not) validate use. (optional, defaultfalse)
Returns array of objects that map population samples to distinct features.
partial∞
Partially apply to a function the first argument and return specialization.
Parameters∞
funcfunction function to be specialized.firststring value to be fixed as first positional argument.
Returns function function with the first argument primed.