@stdlib/utils-async-group-by 0.0.4 → 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/CHANGELOG.md +0 -5
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
|
# groupByAsync
|
|
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
|
> Group values according to an indicator function.
|
|
26
26
|
|
|
@@ -452,6 +452,22 @@ groupByAsync( files, indicator, done );
|
|
|
452
452
|
|
|
453
453
|
<!-- /.references -->
|
|
454
454
|
|
|
455
|
+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
|
|
456
|
+
|
|
457
|
+
<section class="related">
|
|
458
|
+
|
|
459
|
+
* * *
|
|
460
|
+
|
|
461
|
+
## See Also
|
|
462
|
+
|
|
463
|
+
- <span class="package-name">[`@stdlib/utils/async/bifurcate-by`][@stdlib/utils/async/bifurcate-by]</span><span class="delimiter">: </span><span class="description">split values into two groups according to a predicate function.</span>
|
|
464
|
+
- <span class="package-name">[`@stdlib/utils/async/count-by`][@stdlib/utils/async/count-by]</span><span class="delimiter">: </span><span class="description">group values according to an indicator function and return group counts.</span>
|
|
465
|
+
- <span class="package-name">[`@stdlib/utils/group-by`][@stdlib/utils/group-by]</span><span class="delimiter">: </span><span class="description">group values according to an indicator function.</span>
|
|
466
|
+
|
|
467
|
+
</section>
|
|
468
|
+
|
|
469
|
+
<!-- /.related -->
|
|
470
|
+
|
|
455
471
|
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
456
472
|
|
|
457
473
|
|
|
@@ -478,7 +494,7 @@ See [LICENSE][stdlib-license].
|
|
|
478
494
|
|
|
479
495
|
## Copyright
|
|
480
496
|
|
|
481
|
-
Copyright © 2016-
|
|
497
|
+
Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
|
|
482
498
|
|
|
483
499
|
</section>
|
|
484
500
|
|
|
@@ -497,9 +513,20 @@ Copyright © 2016-2021. The Stdlib [Authors][stdlib-authors].
|
|
|
497
513
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/utils-async-group-by/main.svg
|
|
498
514
|
[coverage-url]: https://codecov.io/github/stdlib-js/utils-async-group-by?branch=main
|
|
499
515
|
|
|
516
|
+
<!--
|
|
517
|
+
|
|
500
518
|
[dependencies-image]: https://img.shields.io/david/stdlib-js/utils-async-group-by.svg
|
|
501
519
|
[dependencies-url]: https://david-dm.org/stdlib-js/utils-async-group-by/main
|
|
502
520
|
|
|
521
|
+
-->
|
|
522
|
+
|
|
523
|
+
[umd]: https://github.com/umdjs/umd
|
|
524
|
+
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
525
|
+
|
|
526
|
+
[deno-url]: https://github.com/stdlib-js/utils-async-group-by/tree/deno
|
|
527
|
+
[umd-url]: https://github.com/stdlib-js/utils-async-group-by/tree/umd
|
|
528
|
+
[esm-url]: https://github.com/stdlib-js/utils-async-group-by/tree/esm
|
|
529
|
+
|
|
503
530
|
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
|
|
504
531
|
[chat-url]: https://gitter.im/stdlib-js/stdlib/
|
|
505
532
|
|
|
@@ -515,6 +542,16 @@ Copyright © 2016-2021. The Stdlib [Authors][stdlib-authors].
|
|
|
515
542
|
|
|
516
543
|
[mdn-object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
517
544
|
|
|
545
|
+
<!-- <related-links> -->
|
|
546
|
+
|
|
547
|
+
[@stdlib/utils/async/bifurcate-by]: https://www.npmjs.com/package/@stdlib/utils-async-bifurcate-by
|
|
548
|
+
|
|
549
|
+
[@stdlib/utils/async/count-by]: https://www.npmjs.com/package/@stdlib/utils-async-count-by
|
|
550
|
+
|
|
551
|
+
[@stdlib/utils/group-by]: https://www.npmjs.com/package/@stdlib/utils-group-by
|
|
552
|
+
|
|
553
|
+
<!-- </related-links> -->
|
|
554
|
+
|
|
518
555
|
</section>
|
|
519
556
|
|
|
520
557
|
<!-- /.links -->
|
package/docs/types/index.d.ts
CHANGED
|
@@ -118,7 +118,7 @@ type BinaryIndicator = ( value: any, next: Callback ) => void;
|
|
|
118
118
|
* @param index - collection index
|
|
119
119
|
* @param next - a callback to be invoked after processing a collection `value`
|
|
120
120
|
*/
|
|
121
|
-
type
|
|
121
|
+
type TernaryIndicator = ( value: any, index: number, next: Callback ) => void;
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
124
|
* Checks whether an element in a collection passes a test.
|
|
@@ -138,7 +138,7 @@ type QuaternaryIndicator = ( value: any, index: number, collection: Collection,
|
|
|
138
138
|
* @param collection - input collection
|
|
139
139
|
* @param next - a callback to be invoked after processing a collection `value`
|
|
140
140
|
*/
|
|
141
|
-
type Indicator = Unary | BinaryIndicator |
|
|
141
|
+
type Indicator = Unary | BinaryIndicator | TernaryIndicator | QuaternaryIndicator; // tslint-disable-line max-line-length
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
144
|
* Invokes an indicator function for each element in a collection.
|
package/lib/limit.js
CHANGED
|
@@ -82,7 +82,7 @@ function limit( collection, opts, indicator, done ) {
|
|
|
82
82
|
for ( i = 0; i < lim; i++ ) {
|
|
83
83
|
// This guard is necessary to protect against synchronous functions which exhaust all collection elements...
|
|
84
84
|
if ( idx < maxIndex ) {
|
|
85
|
-
next(); // eslint-disable-line callback-return
|
|
85
|
+
next(); // eslint-disable-line node/callback-return
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
/**
|
package/package.json
CHANGED