value - if defined
Returns a new array of all the values in coll which pass an async truth test. This operation is performed in parallel, but the results array will be in the same order as the original.
A truth test to apply to each item in coll. Invoked with (item, key/index), must return a boolean.
The filtered collection
The same as map but will flatten the results.
A collection to iterate over.
An async function to apply to each item in coll. The iteratee should complete with the transformed item. Invoked with (item, key).
Optionally returns a value after deferring execution. This is useful if you need to wait for anything left on the event loop.
value - if defined
Inverts the given promise - i.e. throws an error if it completes successfully and returns the error if it throws one.
the promise to invert
the message to throw if the promise resolves
the error thrown by the promise
Produces a new collection of values by mapping each value in coll through the iteratee function. The iteratee is called with an item from coll and a callback for when it has finished processing. Each of these callback takes 2 arguments: an error, and the transformed item from coll. If iteratee passes an error to its callback, the main callback (for the map function) is immediately called with the error.
Note, that since this function applies the iteratee to each item in parallel, there is no guarantee that the iteratee functions will complete in order. However, the results array will be in the same order as the original coll.
A collection to iterate over.
An async function to apply to each item in coll. The iteratee should return the transformed item. Invoked with (item, key).
The same as map but runs a maximum of limit async operations at a time. Also does not have the same ordering guarantees.
A collection to iterate over.
The maximum number of async operations at a time.
An async function to apply to each item in coll. The iteratee should complete with the transformed item. Invoked with (item, key).
The same as mapLimit but with only 1 operation at a time, and maintains the ordering guarantees of map.
A collection to iterate over.
An async function to apply to each item in coll. The iteratee should complete with the transformed item. Invoked with (item, key).
Caches the results of an async function. When creating a hash to store function results against, the callback is omitted from the hash and an optional hash function can be used.
If no hash function is specified, the first argument is used as a hash key, which may work reasonably if it is a string or a data type that converts to a distinct string. Note that objects and arrays will not behave reasonably. Neither will cases where the other arguments are significant. In such cases, specify your own hash function.
The async function to proxy and cache results from.
An optional function for generating a custom hash for storing results. It has all the arguments applied to it and must be synchronous.
a memoized version of fn
Attempts to get a successful response from task no more than times times before returning an error. If the task is successful, the callback will be passed the result of the successful task. If all attempts fail, the callback will be passed the error and result (if any) of the final attempt.
An async function to retry.
A wrapped version of function that performs retries
Attempts to settle all promises in promises in parallel, calling errFn when a promise rejects. Similar to Promise.all, but does not fail fast. For resolved promises, the result array contains the resolved value at the same index as the promise. For rejected promises, the result array contains the return value of errFn at the same index as the promise.
An array of promises to attempt to settle.
The function to call when a promise rejects.
A list of resolved and rejected values of promises.
Sets a time limit on an asynchronous function. If the function does return callback within the specified milliseconds, it will be called with a timeout error.
The async function to limit in time.
The specified time limit.
The message that should be sent if the function times out
Returns a wrapped function that will throw an error if it takes too long. Invoke this function with the same parameters as you would fn.
Generated using TypeDoc
Optionally returns a value after a delay. This is useful if you want to add jitter or need to wait for some external reason.
{any} value - the value to return after the delay