Functional JavaScript Library
npm install std-fnsPromise.<(R|never)>Map over the success or error of a promise.
Promise.<(T|never)>Map over the value of a promise. The function provided should return another Promise.
Promise.<(T|never)>Short for left map, map over the error, or catch, of a promise. The function will only be called if the promise provided has fail.
Promise.<(T|never)>Map over the value of a promise. The map function will only be called if the promise is resolved.
Promise.<T>Create a side effect from the value of a promise. The tap function is only called if the promise is resolved.
functionCreates a function which always returns the same value.
*Evaluates all arguments passed and returns the first falsey or last truthy value. It works like && operator.
functionCompose a function from all functions passed as arguments from left to right.
functionCompose a function from all functions passed as arguments from right to left.
functionCurry a function taking arguments from left to right. The constructor function accepts multiple value arguments. Returned functions also accept multiple arguments.
functionCurry a function taking arguments from right to left. The constructor function accepts multiple value arguments. Returned functions also accept multiple arguments.
TPass a value to a function which returns said value.
any | nullCall instance method of an object.
functionCreates a function which negates the value of the result.
Works like the ! operator on the result of the function provided
booleanNegates a argument to a boolean value like the ! operator.
*Evaluates all arguments passed and returns the first truthy or last falsey value. It works like || operator.
functionPartially apply arguments to a function from left to right.
functionPartially apply arguments to a function from right to left.
stringTrims a string. Works like the string trim method.
numberDecrement a number by one.
numberIncrement a number by one.
numberSubtract all numbers passed into the function. It will subtract from left to right, first argument minus the second and then the product minus the next argument and so on.
numberSum all numbers passed into the function. It will sum from left to right, first argument plus the second and then the product plus the next argument and so on.
Promise.<(R\|never)>Kind: global function
| Param | Type |
| --- | --- |
| leftFn | function |
| rightFn | function |
| p | Promise.<(T\|never)> |
Promise.<(T\|never)>Kind: global function
| Param | Type |
| --- | --- |
| fn | function |
| p | Promise.<(T\|never)> |
Promise.<(T\|never)>Kind: global function
| Param | Type |
| --- | --- |
| fn | function |
| p | Promise.<(T\|never)> |
Promise.<(T\|never)>Kind: global function
| Param | Type |
| --- | --- |
| fn | function |
| p | Promise.<(T\|never)> |
Promise.<T>Kind: global function
| Param | Type |
| --- | --- |
| fn | function |
| p | Promise.<T> |
functionKind: global function
| Param | Type |
| --- | --- |
| val | \* |
\*Kind: global function
| Param | Type |
| --- | --- |
| ...args | Array.<mixed> |
functionKind: global function
| Param | Type | Description |
| --- | --- | --- |
| ...fns | function | Comma separated list of functions |
functionKind: global function
| Param | Type |
| --- | --- |
| ...fns | function |
functionKind: global function
| Param | Type | Description |
| --- | --- | --- |
| fn | function | |
| ...initialArgs | Array.<mixed> | Comma separated list of arguments. Can be undefined. |
functionKind: global function
| Param | Type | Description |
| --- | --- | --- |
| fn | function | |
| ...initialArgs | $ReadOnlyArray.<mixed> | Comma separated list of arguments. Can be undefined. |
TKind: global function
| Param | Type |
| --- | --- |
| val | T |
any \| nullKind: global function
| Param | Type |
| --- | --- |
| methodName | String |
| val | Object |
functionKind: global function
| Param | Type |
| --- | --- |
| fn | function |
booleanKind: global function
| Param | Type |
| --- | --- |
| val | \* |
\*Kind: global function
| Param | Type |
| --- | --- |
| ...args | $ReadOnlyArray.<mixed> |
functionKind: global function
| Param | Type | Description |
| --- | --- | --- |
| fn | function | |
| ...args | $ReadOnlyArray.<mixed> | Comma separated list of values. |
functionKind: global function
| Param | Type | Description |
| --- | --- | --- |
| fn | function | |
| ...outerArgs | $ReadOnlyArray.<mixed> | Comma separated list of values. |
stringKind: global function
| Param |
| --- |
| val |
numberKind: global function
| Param | Type |
| --- | --- |
| num | number |
numberKind: global function
| Param | Type |
| --- | --- |
| num | number |
numberKind: global function
| Param | Type | Description |
| --- | --- | --- |
| ...numbers | Array.<number> | Comma separated list of values. |
numberKind: global function
| Param | Type | Description |
| --- | --- | --- |
| ...numbers | Array.<number> | Comma separated list of values. |