#cp.fn.value
A collection of functions for working with values.
#API Overview
Functions - API calls offered directly by the extension
#API Documentation
#Functions
Signature | cp.fn.value.default(...) -> function(...) -> ... |
Type | Function |
Description | A combinator that takes a list of default values and returns a function that accepts a list of values and returns the same number of values, with either the value passed in or the default value if that value is nil . |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | src/extensions/cp/fn/value.lua line 17 |
Signature | cp.fn.value.filter(predicate, ...) -> function(value) -> value | nil |
Type | Function |
Description | Filters a value using a list of predicates which must all be true to succeed. |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | src/extensions/cp/fn/value.lua line 42 |
Signature | cp.fn.value.is(other) -> function(value) -> boolean |
Type | Function |
Description | Returns a function that returns true if the value is equal to the other value. If other is a function, then it will be called with no arguments and the result will be compared. |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | src/extensions/cp/fn/value.lua line 95 |
Signature | cp.fn.value.map(mapper) -> function(value) -> any | nil |
Type | Function |
Description | If the value is not nil , then it will be passed to the mapper function and the result returned. |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | src/extensions/cp/fn/value.lua line 61 |
Signature | cp.fn.value.matches(predicate, ...) -> function(value) -> boolean |
Type | Function |
Description | Returns a function that returns true if the value matches the predicates. |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | src/extensions/cp/fn/value.lua line 78 |