Function
Static Public Summary | ||
public |
Composes the functions right-to-left. |
|
public |
Flattens |
|
public |
Composes the functions left-to-right. |
|
public |
Converts string to upper case. |
Static Public
public compose(funcs: ...Function): Function source
import compose from 'remram/src/function/compose.js'
Composes the functions right-to-left.
Params:
Name | Type | Attribute | Description |
funcs | ...Function | The functions to compose. |
Example:
const inc = value => value + 1
const double = value => value * 2
const incAndDouble = compose(double, inc)
incAndDouble(1)
// => 4
public flatten(array: Array): Array source
import flatten from 'remram/src/array/flatten.js'
Flattens array
a single level deep.
Params:
Name | Type | Attribute | Description |
array | Array | The array to flatten. |
Example:
flatten([1, [2, [3]]])
// => [1, 2, [3]]
public flow(funcs: ...Function): Function source
import flow from 'remram/src/function/flow.js'
Composes the functions left-to-right.
Params:
Name | Type | Attribute | Description |
funcs | ...Function | The functions to compose. |
Example:
const inc = value => value + 1
const double = value => value * 2
const incAndDouble = flow(inc, double)
incAndDouble(1)
// => 4