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
+21-10Lines changed: 21 additions & 10 deletions
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. If provided, the function sets `options.series=false`. Default: `infinity`.
126
-
-`series`: `boolean` indicating whether to sequentially invoke `reducer` for each `collection` element. If `true`, the function sets `options.limit=1`. Default: `true`.
127
-
-`thisArg`: the execution context for `reducer`.
136
+
-**limit**: the maximum number of pending invocations at any one time. If provided, the function sets `options.series=false`. Default: `infinity`.
137
+
-**series**: boolean indicating whether to sequentially invoke `reducer` for each `collection` element. If `true`, the function sets `options.limit=1`. Default: `true`.
138
+
-**thisArg**: the execution context for `reducer`.
128
139
129
140
By default, all elements are processed **sequentially**, which means that the function **does** guarantee completion order. To process each `collection` element concurrently, set the `series` option to `false`.
130
141
@@ -244,11 +255,11 @@ function done( error, acc ) {
244
255
245
256
When invoked, `reducer` is provided a maximum of five arguments:
246
257
247
-
-`accumulator`: accumulated value.
248
-
-`value`: collection value.
249
-
-`index`: collection index.
250
-
-`collection`: the input `collection`.
251
-
-`next`: a callback which should be called once `reducer` has finished processing a collection `value`.
258
+
-**accumulator**: accumulated value.
259
+
-**value**: collection value.
260
+
-**index**: collection index.
261
+
-**collection**: the input `collection`.
262
+
-**next**: a callback which should be called once `reducer` has finished processing a collection `value`.
252
263
253
264
The actual number of provided arguments depends on function `length`. If `reducer` accepts three arguments, `reducer` is provided `accumulator`, `value` and `next`. If `reducer` accepts four arguments, `reducer` is provided `accumulator`, `value`, `index`, and `next`. For every other `reducer` signature, `reducer` is provided all five arguments.
Copy file name to clipboardExpand all lines: docs/types/index.d.ts
+20-25Lines changed: 20 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -16,30 +16,30 @@
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,U,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<Reducer<T,U,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: true).
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 reducer function for each `collection` element. If `true`, the function sets `options.limit=1`. Default: true.
* - 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.
133
133
* - 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`).
* Applies a function against an accumulator and each element in a collection and return the accumulated result.
@@ -187,7 +186,6 @@ interface ReduceAsync {
187
186
* - 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.
188
187
* - 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`).
189
188
*
190
-
*
191
189
* @param collection - input collection
192
190
* @param initial - initial value
193
191
* @param reducer - function to invoke for each element in a collection
* Returns a function to apply a function against an accumulator and each element in a collection and return the accumulated result.
@@ -237,7 +235,6 @@ interface ReduceAsync {
237
235
* - 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.
238
236
* - 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`).
239
237
*
240
-
*
241
238
* @param options - function options
242
239
* @param options.thisArg - execution context
243
240
* @param options.limit - maximum number of pending invocations at any one time
* Returns a function to apply a function against an accumulator and each element in a collection and return the accumulated result.
@@ -301,7 +298,6 @@ interface ReduceAsync {
301
298
* - 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.
302
299
* - 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`).
303
300
*
304
-
*
305
301
* @param reducer - function to invoke for each element in a collection
306
302
* @throws must provide valid options
307
303
* @returns function which invokes the provided function once for each element in a collection
* - 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.
359
355
* - 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