Skip to content

Latest commit

 

History

History
240 lines (177 loc) · 6.61 KB

API.md

File metadata and controls

240 lines (177 loc) · 6.61 KB

Functions

isBlank(str)

Returns true if the value is falsy or an empty string

notBlank(values)Array.<any>

Returns non-blank values

notEqual(values, config)Array.<any>

Returns values which do not match the specified value

replace(values, config)Array.<any>

Returns values after replacing the specified pattern with the specified replacement

anyMatch(values, config)

Returns the match value if the values matches the pattern and the nonMatch value otherwise

first(values)

Gets the first non-blank value

highest(values)

Gets the highest value by natural sort

lowest(values)

Gets the lowest value by natural sort

unique(values, config)

Gets the unique values

alternateValue(record, config)

Returns the value of the alternateField if the value of the testField equals the testValue. Otherwise returns the value of the defaultField.

getValue(record, config)

Returns the value of a different field name than the field to which the data will be saved

Typedefs

MappingFunctionArray.<any>
ReducingFunctionany
ValueSourceany
FieldRule
NormalizationConfig

isBlank(str) ⇒

Returns true if the value is falsy or an empty string

Kind: global function
Returns: true if the value is blank, false otherwise

Param Type Description
str any the value to check

notBlank(values) ⇒ Array.<any>

Returns non-blank values

Kind: global function

Param Type
values Array.<any>

notEqual(values, config) ⇒ Array.<any>

Returns values which do not match the specified value

Kind: global function

Param Type
values Array.<any>
config Object

replace(values, config) ⇒ Array.<any>

Returns values after replacing the specified pattern with the specified replacement

Kind: global function

Param Type
values Array.<any>
config Object

anyMatch(values, config)

Returns the match value if the values matches the pattern and the nonMatch value otherwise

Kind: global function

Param Type
values Array.<any>
config Object

first(values)

Gets the first non-blank value

Kind: global function

Param Type
values Array.<any>

highest(values)

Gets the highest value by natural sort

Kind: global function

Param Type
values Array.<any>

lowest(values)

Gets the lowest value by natural sort

Kind: global function

Param Type
values Array

unique(values, config)

Gets the unique values

Kind: global function

Param Type
values Array
config Object

alternateValue(record, config)

Returns the value of the alternateField if the value of the testField equals the testValue. Otherwise returns the value of the defaultField.

Kind: global function

Param Type
record Record.<string, any>
config Object

getValue(record, config)

Returns the value of a different field name than the field to which the data will be saved

Kind: global function

Param Type
record Record.<string, any>
config Object

MappingFunction ⇒ Array.<any>

Kind: global typedef
Returns: Array.<any> - the mapped value

Param Type Description
values Array.<any> the values to map
config any the configuration provided for the mapper

ReducingFunction ⇒ any

Kind: global typedef
Returns: any - the reduced value

Param Type Description
values Array.<any> the values to reduce
config any the configuration provided for the reducer

ValueSource ⇒ any

Kind: global typedef
Returns: any - the extracted value

Param Type Description
record Record.<string, any> the record from which to extract the value
[config] any the configuration for the function

FieldRule

Kind: global typedef
Properties

Name Type Description
reducer string | Object the name of the reducer function to execute on the field
[mappers] Array.<(string|Object)> the mapping functions to execute on this field
[source] string | Object the function to retrieve the value for the field

NormalizationConfig

Kind: global typedef
Properties

Name Type Description
primaryKey string the primary key for performing the merging
primarySources Array.<string> the source fields to retrieve the primary key
fieldRules Record.<string, FieldRule> the rules for how to normalize each field