@stdlib/utils-async-inmap 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +1 -1
- package/README.md +39 -2
- package/docs/types/index.d.ts +2 -2
- package/lib/limit.js +1 -1
- package/package.json +1 -1
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2022 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ limitations under the License.
|
|
|
20
20
|
|
|
21
21
|
# inmapAsync
|
|
22
22
|
|
|
23
|
-
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] [![dependencies][dependencies-image]][dependencies-url]
|
|
23
|
+
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
|
|
24
24
|
|
|
25
25
|
> Invoke a function for each element in a collection and update the collection in-place.
|
|
26
26
|
|
|
@@ -423,6 +423,22 @@ inmapAsync( files, read, done );
|
|
|
423
423
|
|
|
424
424
|
<!-- /.references -->
|
|
425
425
|
|
|
426
|
+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
|
|
427
|
+
|
|
428
|
+
<section class="related">
|
|
429
|
+
|
|
430
|
+
* * *
|
|
431
|
+
|
|
432
|
+
## See Also
|
|
433
|
+
|
|
434
|
+
- <span class="package-name">[`@stdlib/utils/async/for-each`][@stdlib/utils/async/for-each]</span><span class="delimiter">: </span><span class="description">invoke a function once for each element in a collection.</span>
|
|
435
|
+
- <span class="package-name">[`@stdlib/utils/async/inmap-right`][@stdlib/utils/async/inmap-right]</span><span class="delimiter">: </span><span class="description">invoke a function for each element in a collection and update the collection in-place, iterating from right to left.</span>
|
|
436
|
+
- <span class="package-name">[`@stdlib/utils/inmap`][@stdlib/utils/inmap]</span><span class="delimiter">: </span><span class="description">invoke a function for each element in a collection and update the collection in-place.</span>
|
|
437
|
+
|
|
438
|
+
</section>
|
|
439
|
+
|
|
440
|
+
<!-- /.related -->
|
|
441
|
+
|
|
426
442
|
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
427
443
|
|
|
428
444
|
|
|
@@ -449,7 +465,7 @@ See [LICENSE][stdlib-license].
|
|
|
449
465
|
|
|
450
466
|
## Copyright
|
|
451
467
|
|
|
452
|
-
Copyright © 2016-
|
|
468
|
+
Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
|
|
453
469
|
|
|
454
470
|
</section>
|
|
455
471
|
|
|
@@ -468,9 +484,20 @@ Copyright © 2016-2021. The Stdlib [Authors][stdlib-authors].
|
|
|
468
484
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/utils-async-inmap/main.svg
|
|
469
485
|
[coverage-url]: https://codecov.io/github/stdlib-js/utils-async-inmap?branch=main
|
|
470
486
|
|
|
487
|
+
<!--
|
|
488
|
+
|
|
471
489
|
[dependencies-image]: https://img.shields.io/david/stdlib-js/utils-async-inmap.svg
|
|
472
490
|
[dependencies-url]: https://david-dm.org/stdlib-js/utils-async-inmap/main
|
|
473
491
|
|
|
492
|
+
-->
|
|
493
|
+
|
|
494
|
+
[umd]: https://github.com/umdjs/umd
|
|
495
|
+
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
496
|
+
|
|
497
|
+
[deno-url]: https://github.com/stdlib-js/utils-async-inmap/tree/deno
|
|
498
|
+
[umd-url]: https://github.com/stdlib-js/utils-async-inmap/tree/umd
|
|
499
|
+
[esm-url]: https://github.com/stdlib-js/utils-async-inmap/tree/esm
|
|
500
|
+
|
|
474
501
|
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
|
|
475
502
|
[chat-url]: https://gitter.im/stdlib-js/stdlib/
|
|
476
503
|
|
|
@@ -486,6 +513,16 @@ Copyright © 2016-2021. The Stdlib [Authors][stdlib-authors].
|
|
|
486
513
|
|
|
487
514
|
[mdn-object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
488
515
|
|
|
516
|
+
<!-- <related-links> -->
|
|
517
|
+
|
|
518
|
+
[@stdlib/utils/async/for-each]: https://www.npmjs.com/package/@stdlib/utils-async-for-each
|
|
519
|
+
|
|
520
|
+
[@stdlib/utils/async/inmap-right]: https://www.npmjs.com/package/@stdlib/utils-async-inmap-right
|
|
521
|
+
|
|
522
|
+
[@stdlib/utils/inmap]: https://www.npmjs.com/package/@stdlib/utils-inmap
|
|
523
|
+
|
|
524
|
+
<!-- </related-links> -->
|
|
525
|
+
|
|
489
526
|
</section>
|
|
490
527
|
|
|
491
528
|
<!-- /.links -->
|
package/docs/types/index.d.ts
CHANGED
|
@@ -109,7 +109,7 @@ type BinaryFcn = ( value: any, next: Callback ) => void;
|
|
|
109
109
|
* @param index - collection index
|
|
110
110
|
* @param next - a callback to be invoked after processing a collection `value`
|
|
111
111
|
*/
|
|
112
|
-
type
|
|
112
|
+
type TernaryFcn = ( value: any, index: number, next: Callback ) => void;
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
115
|
* Function invoked for each element in a collection.
|
|
@@ -129,7 +129,7 @@ type QuaternaryFcn = ( value: any, index: number, collection: Collection, next:
|
|
|
129
129
|
* @param collection - input collection
|
|
130
130
|
* @param next - a callback to be invoked after processing a collection `value`
|
|
131
131
|
*/
|
|
132
|
-
type Fcn = BinaryFcn |
|
|
132
|
+
type Fcn = BinaryFcn | TernaryFcn | QuaternaryFcn;
|
|
133
133
|
|
|
134
134
|
/**
|
|
135
135
|
* Invokes the provided function for each element in a collection and updates a collection in-place.
|
package/lib/limit.js
CHANGED
|
@@ -72,7 +72,7 @@ function limit( collection, opts, fcn, done ) {
|
|
|
72
72
|
for ( i = 0; i < lim; i++ ) {
|
|
73
73
|
// This guard is necessary to protect against synchronous functions which exhaust all collection elements...
|
|
74
74
|
if ( idx < maxIndex ) {
|
|
75
|
-
next(); // eslint-disable-line callback-return
|
|
75
|
+
next(); // eslint-disable-line node/callback-return
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
/**
|