You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency:
Copy file name to clipboardExpand all lines: README.md
+19-8
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,17 @@ limitations under the License.
18
18
19
19
-->
20
20
21
+
22
+
<details>
23
+
<summary>
24
+
About stdlib...
25
+
</summary>
26
+
<p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
27
+
<p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
28
+
<p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
29
+
<p>To join us in bringing numerical computing to the web, get started by checking us out on <ahref="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <ahref="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
-`limit`: the maximum number of pending invocations at any one time. Default: `infinity`.
95
-
-`series`: `boolean` indicating whether to sequentially invoke `fcn` for each `collection` element. If `true`, the function sets `options.limit=1`. Default: `false`.
96
-
-`thisArg`: the execution context for `fcn`.
105
+
-**limit**: the maximum number of pending invocations at any one time. Default: `infinity`.
106
+
-**series**: boolean indicating whether to sequentially invoke `fcn` for each `collection` element. If `true`, the function sets `options.limit=1`. Default: `false`.
107
+
-**thisArg**: the execution context for `fcn`.
97
108
98
109
By default, all elements are processed concurrently, which means that the function does **not** guarantee completion order. To process each `collection` element sequentially, set the `series` option to `true`.
99
110
@@ -191,10 +202,10 @@ function done( error ) {
191
202
192
203
When invoked, `fcn` is provided a maximum of four arguments:
193
204
194
-
-`value`: collection value.
195
-
-`index`: collection index.
196
-
-`collection`: the input `collection`.
197
-
-`next`: a callback which should be called once `fcn` has finished processing a collection `value`.
205
+
-**value**: collection value.
206
+
-**index**: collection index.
207
+
-**collection**: the input `collection`.
208
+
-**next**: a callback which should be called once `fcn` has finished processing a collection `value`.
198
209
199
210
The actual number of provided arguments depends on function `length`. If `fcn` accepts two arguments, `fcn` is provided `value` and `next`. If `fcn` accepts three arguments, `fcn` is provided `value`, `index`, and `next`. For every other `fcn` signature, `fcn` is provided all four arguments.
Copy file name to clipboardExpand all lines: docs/types/index.d.ts
+27-24
Original file line number
Diff line number
Diff line change
@@ -16,58 +16,65 @@
16
16
* limitations under the License.
17
17
*/
18
18
19
-
// TypeScript Version: 2.0
19
+
// TypeScript Version: 4.1
20
20
21
21
/// <reference types="@stdlib/types"/>
22
22
23
-
import{Collection}from'@stdlib/types/object';
23
+
import{Collection}from'@stdlib/types/array';
24
24
25
25
/**
26
26
* Interface defining function options.
27
27
*/
28
-
interfaceOptions{
28
+
interfaceOptions<T,V>{
29
29
/**
30
-
* The maximum number of pending invocations at any one time.
30
+
* Execution context.
31
31
*/
32
-
limit?: number;
32
+
thisArg?: ThisParameterType<Fcn<T,V>>;
33
33
34
34
/**
35
-
* Boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection (default: false).
35
+
* The maximum number of pending invocations at any one time.
36
36
*/
37
-
series?: boolean;
37
+
limit?: number;
38
38
39
39
/**
40
-
* Execution context.
40
+
* Boolean indicating whether to sequentially invoke the provided function for each `collection` element. If `true`, the function sets `options.limit=1`. Default: false.
41
41
*/
42
-
thisArg?: any;
42
+
series?: boolean;
43
43
}
44
44
45
45
/**
46
46
* Callback function.
47
47
*/
48
-
typeNullaryCallback=()=>void;
48
+
typeNullary=()=>void;
49
49
50
50
/**
51
51
* Callback function.
52
52
*
53
53
* @param error - encountered error
54
54
*/
55
-
typeUnaryCallback=(error: Error)=>void;
55
+
typeUnary=(error: Error)=>void;
56
56
57
57
/**
58
58
* Callback function.
59
59
*
60
60
* @param error - encountered error
61
61
*/
62
-
typeCallback=NullaryCallback|UnaryCallback;
62
+
typeCallback=Nullary|Unary;
63
+
64
+
/**
65
+
* Callback function to invoke once the provided function has finished processing a collection value.
66
+
*
67
+
* @param error - encountered error
68
+
*/
69
+
typeNext=Nullary|Unary;
63
70
64
71
/**
65
72
* Function invoked for each element in a collection.
66
73
*
67
74
* @param value - collection value
68
75
* @param next - a callback to be invoked after processing a collection `value`
* Function which invokes the provided function once for each element in a collection.
@@ -118,7 +125,6 @@ interface ForEachAsync {
118
125
* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.
119
126
* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).
* Invokes a function once for each element in a collection.
@@ -170,7 +176,6 @@ interface ForEachAsync {
170
176
* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.
171
177
* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).
* Returns a function to invoke a function once for each element in a collection.
@@ -222,7 +227,6 @@ interface ForEachAsync {
222
227
* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.
223
228
* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).
224
229
*
225
-
*
226
230
* @param options - function options
227
231
* @param options.thisArg - execution context
228
232
* @param options.limit - maximum number of pending invocations at any one time
* - If a provided function calls the provided callback with a truthy error argument, the function suspends execution and immediately calls the `done` callback for subsequent error handling.
336
340
* - This function does **not** guarantee that execution is asynchronous. To do so, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setImmediate`, `setTimeout`).
0 commit comments