@stdlib/utils-async-group-by 0.0.8 → 0.1.0

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/CITATION.cff ADDED
@@ -0,0 +1,30 @@
1
+ cff-version: 1.2.0
2
+ title: stdlib
3
+ message: >-
4
+ If you use this software, please cite it using the
5
+ metadata from this file.
6
+
7
+ type: software
8
+
9
+ authors:
10
+ - name: The Stdlib Authors
11
+ url: https://github.com/stdlib-js/stdlib/graphs/contributors
12
+
13
+ repository-code: https://github.com/stdlib-js/stdlib
14
+ url: https://stdlib.io
15
+
16
+ abstract: |
17
+ Standard library for JavaScript and Node.js.
18
+
19
+ keywords:
20
+ - JavaScript
21
+ - Node.js
22
+ - TypeScript
23
+ - standard library
24
+ - scientific computing
25
+ - numerical computing
26
+ - statistical computing
27
+
28
+ license: Apache-2.0 AND BSL-1.0
29
+
30
+ date-released: 2016
package/LICENSE CHANGED
@@ -175,307 +175,3 @@
175
175
  of your accepting any such warranty or additional liability.
176
176
 
177
177
  END OF TERMS AND CONDITIONS
178
-
179
-
180
-
181
- Boost Software License - Version 1.0 - August 17th, 2003
182
-
183
- Permission is hereby granted, free of charge, to any person or organization
184
- obtaining a copy of the software and accompanying documentation covered by this
185
- license (the "Software") to use, reproduce, display, distribute, execute, and
186
- transmit the Software, and to prepare derivative works of the Software, and to
187
- permit third-parties to whom the Software is furnished to do so, all subject to
188
- the following:
189
-
190
- The copyright notices in the Software and this entire statement, including the
191
- above license grant, this restriction and the following disclaimer, must be
192
- included in all copies of the Software, in whole or in part, and all derivative
193
- works of the Software, unless such copies or derivative works are solely in the
194
- form of machine-executable object code generated by a source language processor.
195
-
196
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
197
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
198
- FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
199
- COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES
200
- OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
201
- OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
202
-
203
-
204
-
205
-
206
- DEPENDENCIES
207
-
208
- The library links against the following external libraries, which have their own
209
- licenses:
210
-
211
- * OpenBLAS <https://raw.githubusercontent.com/xianyi/OpenBLAS/
212
- def146efed8d5908ea04e22668feeab7099599a0/LICENSE>
213
-
214
- Copyright (c) 2011-2014, The OpenBLAS Project
215
- All rights reserved.
216
-
217
- Redistribution and use in source and binary forms, with or without
218
- modification, are permitted provided that the following conditions are
219
- met:
220
-
221
- 1. Redistributions of source code must retain the above copyright
222
- notice, this list of conditions and the following disclaimer.
223
-
224
- 2. Redistributions in binary form must reproduce the above copyright
225
- notice, this list of conditions and the following disclaimer in
226
- the documentation and/or other materials provided with the
227
- distribution.
228
-
229
- 3. Neither the name of the OpenBLAS project nor the names of
230
- its contributors may be used to endorse or promote products
231
- derived from this software without specific prior written
232
- permission.
233
-
234
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
235
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
236
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
237
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
238
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
239
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
240
- GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
241
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
242
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
243
- THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
244
-
245
-
246
- * Electron <https://raw.githubusercontent.com/electron/electron/
247
- c4cfb3e7110266b9d7ad80e1ae097c4db564501c/LICENSE>
248
-
249
- Copyright (c) 2013-2017 GitHub Inc.
250
-
251
- Permission is hereby granted, free of charge, to any person obtaining
252
- a copy of this software and associated documentation files (the
253
- "Software"), to deal in the Software without restriction, including
254
- without limitation the rights to use, copy, modify, merge, publish,
255
- distribute, sublicense, and/or sell copies of the Software, and to
256
- permit persons to whom the Software is furnished to do so, subject to
257
- the following conditions:
258
-
259
- The above copyright notice and this permission notice shall be
260
- included in all copies or substantial portions of the Software.
261
-
262
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
263
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
264
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
265
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
266
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
267
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
268
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
269
-
270
-
271
- * Boost <http://www.boost.org/LICENSE_1_0.txt>
272
-
273
- Boost Software License - Version 1.0 - August 17th, 2003
274
-
275
- Permission is hereby granted, free of charge, to any person or organization
276
- obtaining a copy of the software and accompanying documentation covered by
277
- this license (the "Software") to use, reproduce, display, distribute,
278
- execute, and transmit the Software, and to prepare derivative works of the
279
- Software, and to permit third-parties to whom the Software is furnished to
280
- do so, all subject to the following:
281
-
282
- The copyright notices in the Software and this entire statement, including
283
- the above license grant, this restriction and the following disclaimer,
284
- must be included in all copies of the Software, in whole or in part, and
285
- all derivative works of the Software, unless such copies or derivative
286
- works are solely in the form of machine-executable object code generated by
287
- a source language processor.
288
-
289
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
290
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
291
- FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
292
- SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
293
- FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
294
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
295
- DEALINGS IN THE SOFTWARE.
296
-
297
-
298
- * Cephes <http://www.netlib.org/cephes/readme>
299
-
300
- Copyright (c) 1984-2000 Stephen L. Moshier
301
-
302
- Some software in this archive may be from the book _Methods and Programs for
303
- Mathematical Functions_ (Prentice-Hall or Simon & Schuster International, 1989)
304
- or from the Cephes Mathematical Library, a commercial product. In either event,
305
- it is copyrighted by the author. What you see here may be used freely but it
306
- comes with no support or guarantee.
307
-
308
- Stephen L. Moshier
309
- moshier@na-net.ornl.gov
310
-
311
-
312
-
313
- ATTRIBUTION
314
-
315
- The library contains implementations from the following external libraries,
316
- which have their own licenses:
317
-
318
- * FreeBSD <https://svnweb.freebsd.org/>
319
-
320
- Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved.
321
-
322
- Developed at SunPro, a Sun Microsystems, Inc. business.
323
- Permission to use, copy, modify, and distribute this
324
- software is freely granted, provided that this notice
325
- is preserved.
326
-
327
-
328
- * FDLIBM <http://www.netlib.org/fdlibm/>
329
-
330
- Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
331
-
332
- Developed at SunPro, a Sun Microsystems, Inc. business.
333
- Permission to use, copy, modify, and distribute this
334
- software is freely granted, provided that this notice
335
- is preserved.
336
-
337
-
338
- * Go <https://raw.githubusercontent.com/golang/go/master/LICENSE>
339
-
340
- Copyright (c) 2009 The Go Authors. All rights reserved.
341
-
342
- Redistribution and use in source and binary forms, with or without
343
- modification, are permitted provided that the following conditions are
344
- met:
345
-
346
- * Redistributions of source code must retain the above copyright
347
- notice, this list of conditions and the following disclaimer.
348
- * Redistributions in binary form must reproduce the above
349
- copyright notice, this list of conditions and the following disclaimer
350
- in the documentation and/or other materials provided with the
351
- distribution.
352
- * Neither the name of Google Inc. nor the names of its
353
- contributors may be used to endorse or promote products derived from
354
- this software without specific prior written permission.
355
-
356
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
357
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
358
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
359
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
360
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
361
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
362
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
363
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
364
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
365
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
366
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
367
-
368
-
369
- * SLATEC Common Mathematical Library <http://www.netlib.no/netlib/slatec/>
370
-
371
- Public domain.
372
-
373
-
374
- * ESLint <https://raw.githubusercontent.com/eslint/eslint/master/LICENSE>
375
-
376
- Copyright JS Foundation and other contributors, https://js.foundation
377
-
378
- Permission is hereby granted, free of charge, to any person obtaining a copy
379
- of this software and associated documentation files (the "Software"), to deal
380
- in the Software without restriction, including without limitation the rights
381
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
382
- copies of the Software, and to permit persons to whom the Software is
383
- furnished to do so, subject to the following conditions:
384
-
385
- The above copyright notice and this permission notice shall be included in
386
- all copies or substantial portions of the Software.
387
-
388
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
389
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
390
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
391
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
392
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
393
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
394
- THE SOFTWARE.
395
-
396
-
397
- * StatsFuns.jl <https://raw.githubusercontent.com/JuliaStats/StatsFuns.jl/
398
- e66dd973650c375bc1739c820e5b96bb5bd000a8/LICENSE.md>
399
-
400
- Copyright (c) 2015: Dahua Lin.
401
-
402
- Permission is hereby granted, free of charge, to any person obtaining
403
- a copy of this software and associated documentation files (the
404
- "Software"), to deal in the Software without restriction, including
405
- without limitation the rights to use, copy, modify, merge, publish,
406
- distribute, sublicense, and/or sell copies of the Software, and to
407
- permit persons to whom the Software is furnished to do so, subject to
408
- the following conditions:
409
-
410
- The above copyright notice and this permission notice shall be
411
- included in all copies or substantial portions of the Software.
412
-
413
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
414
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
415
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
416
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
417
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
418
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
419
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
420
-
421
-
422
- * SpecialFunctions.jl <https://raw.githubusercontent.com/JuliaMath/
423
- SpecialFunctions.jl/02a173fbe24a61c4b392aec17a9764ac5727feb1/LICENSE>
424
-
425
- The MIT License (MIT)
426
-
427
- Copyright (c) 2017 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and others:
428
-
429
- https://github.com/JuliaMath/SpecialFunctions.jl/graphs/contributors
430
-
431
- Permission is hereby granted, free of charge, to any person obtaining a copy
432
- of this software and associated documentation files (the "Software"), to deal
433
- in the Software without restriction, including without limitation the rights
434
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
435
- copies of the Software, and to permit persons to whom the Software is
436
- furnished to do so, subject to the following conditions:
437
-
438
- The above copyright notice and this permission notice shall be included in all
439
- copies or substantial portions of the Software.
440
-
441
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
442
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
443
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
444
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
445
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
446
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
447
- SOFTWARE.
448
-
449
-
450
- * MT19937 <http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/
451
- mt19937ar.c>
452
-
453
- Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
454
- All rights reserved.
455
-
456
- Redistribution and use in source and binary forms, with or without
457
- modification, are permitted provided that the following conditions
458
- are met:
459
-
460
- 1. Redistributions of source code must retain the above copyright
461
- notice, this list of conditions and the following disclaimer.
462
-
463
- 2. Redistributions in binary form must reproduce the above copyright
464
- notice, this list of conditions and the following disclaimer in the
465
- documentation and/or other materials provided with the distribution.
466
-
467
- 3. The names of its contributors may not be used to endorse or promote
468
- products derived from this software without specific prior written
469
- permission.
470
-
471
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
472
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
473
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
474
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
475
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
476
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
477
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
478
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
479
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
480
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
481
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/NOTICE CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2022 The Stdlib Authors.
1
+ Copyright (c) 2016-2023 The Stdlib Authors.
package/README.md CHANGED
@@ -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 <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
30
+ </details>
31
+
21
32
  # groupByAsync
22
33
 
23
34
  [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
@@ -85,10 +96,10 @@ groupByAsync( arr, indicator, done );
85
96
 
86
97
  The function accepts the following `options`:
87
98
 
88
- - `limit`: the maximum number of pending invocations at any one time. Default: `infinity`.
89
- - `series`: `boolean` indicating whether to sequentially invoke the `indicator` function for each `collection` element. If `true`, the function sets `options.limit=1`. Default: `false`.
90
- - `returns`: specifies the output format. If the option equals `'values'`, the function returns group results as element values. If the option equals `'indices'`, the function returns group results as element indices. If the option equals `'*'`, the function returns group results as both element indices and values. Default: `'values'`.
91
- - `thisArg`: the execution context for `indicator`.
99
+ - **limit**: the maximum number of pending invocations at any one time. Default: `infinity`.
100
+ - **series**: boolean indicating whether to sequentially invoke the `indicator` function for each `collection` element. If `true`, the function sets `options.limit=1`. Default: `false`.
101
+ - **returns**: specifies the output format. If the option equals `'values'`, the function returns group results as element values. If the option equals `'indices'`, the function returns group results as element indices. If the option equals `'*'`, the function returns group results as both element indices and values. Default: `'values'`.
102
+ - **thisArg**: the execution context for `indicator`.
92
103
 
93
104
  By default, the function returns group results as element values. To return element indices, set the `returns` option to `'indices'`.
94
105
 
@@ -257,10 +268,10 @@ function done( error, result ) {
257
268
 
258
269
  When invoked, the `indicator` function is provided a maximum of four arguments:
259
270
 
260
- - `value`: collection value.
261
- - `index`: collection index.
262
- - `collection`: the input `collection`.
263
- - `next`: a callback which should be called once the `indicator` function has finished processing a collection `value`.
271
+ - **value**: collection value.
272
+ - **index**: collection index.
273
+ - **collection**: the input `collection`.
274
+ - **next**: a callback which should be called once the `indicator` function has finished processing a collection `value`.
264
275
 
265
276
  The actual number of provided arguments depends on function `length`. If the `indicator` function accepts two arguments, the `indicator` function is provided `value` and `next`. If the `indicator` function accepts three arguments, the `indicator` function is provided `value`, `index`, and `next`. For every other `indicator` function signature, the `indicator` function is provided all four arguments.
266
277
 
@@ -297,7 +308,7 @@ groupByAsync( arr, indicator, done );
297
308
 
298
309
  #### groupByAsync.factory( \[options,] indicator )
299
310
 
300
- Returns a `function` which invokes an `indicator` function once for each element in a `collection`.
311
+ Returns a function which invokes an `indicator` function once for each element in a `collection`.
301
312
 
302
313
  ```javascript
303
314
  function indicator( value, next ) {
@@ -391,7 +402,7 @@ The function accepts the same `options` as `groupByAsync()`.
391
402
  */
392
403
  ```
393
404
 
394
- while each group identifier is unique, all collection elements resolve to the same group because each group identifier serializes to the same `string`.
405
+ while each group identifier is unique, all collection elements resolve to the same group because each group identifier serializes to the same string.
395
406
 
396
407
  </section>
397
408
 
@@ -460,9 +471,9 @@ groupByAsync( files, indicator, done );
460
471
 
461
472
  ## See Also
462
473
 
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>
474
+ - <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>
475
+ - <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>
476
+ - <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
477
 
467
478
  </section>
468
479
 
@@ -494,7 +505,7 @@ See [LICENSE][stdlib-license].
494
505
 
495
506
  ## Copyright
496
507
 
497
- Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
508
+ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
498
509
 
499
510
  </section>
500
511
 
@@ -507,8 +518,8 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
507
518
  [npm-image]: http://img.shields.io/npm/v/@stdlib/utils-async-group-by.svg
508
519
  [npm-url]: https://npmjs.org/package/@stdlib/utils-async-group-by
509
520
 
510
- [test-image]: https://github.com/stdlib-js/utils-async-group-by/actions/workflows/test.yml/badge.svg
511
- [test-url]: https://github.com/stdlib-js/utils-async-group-by/actions/workflows/test.yml
521
+ [test-image]: https://github.com/stdlib-js/utils-async-group-by/actions/workflows/test.yml/badge.svg?branch=v0.1.0
522
+ [test-url]: https://github.com/stdlib-js/utils-async-group-by/actions/workflows/test.yml?query=branch:v0.1.0
512
523
 
513
524
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/utils-async-group-by/main.svg
514
525
  [coverage-url]: https://codecov.io/github/stdlib-js/utils-async-group-by?branch=main
@@ -520,19 +531,20 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
520
531
 
521
532
  -->
522
533
 
534
+ [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
535
+ [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
536
+
537
+ [stdlib]: https://github.com/stdlib-js/stdlib
538
+
539
+ [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
540
+
523
541
  [umd]: https://github.com/umdjs/umd
524
542
  [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
525
543
 
526
544
  [deno-url]: https://github.com/stdlib-js/utils-async-group-by/tree/deno
527
545
  [umd-url]: https://github.com/stdlib-js/utils-async-group-by/tree/umd
528
546
  [esm-url]: https://github.com/stdlib-js/utils-async-group-by/tree/esm
529
-
530
- [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
531
- [chat-url]: https://gitter.im/stdlib-js/stdlib/
532
-
533
- [stdlib]: https://github.com/stdlib-js/stdlib
534
-
535
- [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
547
+ [branches-url]: https://github.com/stdlib-js/utils-async-group-by/blob/main/branches.md
536
548
 
537
549
  [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/utils-async-group-by/main/LICENSE
538
550
 
@@ -0,0 +1,3 @@
1
+ /// <reference path="../docs/types/index.d.ts" />
2
+ import groupByAsync from '../docs/types/index';
3
+ export = groupByAsync;
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ "use strict";var h=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var F=h(function($,C){
2
+ var R=require('@stdlib/assert-is-plain-object/dist'),y=require('@stdlib/assert-has-own-property/dist'),S=require('@stdlib/assert-is-boolean/dist').isPrimitive,p=require('@stdlib/assert-is-positive-integer/dist').isPrimitive,z=require('@stdlib/utils-index-of/dist'),q=require('@stdlib/error-tools-fmtprodmsg/dist'),T=["values","indices","*"];function D(r,e){return R(e)?(y(e,"thisArg")&&(r.thisArg=e.thisArg),y(e,"series")&&(r.series=e.series,!S(r.series))?new TypeError(q('1RD2o',"series",r.series)):y(e,"limit")&&(r.limit=e.limit,!p(r.limit))?new TypeError(q('1RD3P',"limit",r.limit)):y(e,"returns")&&(r.returns=e.returns,z(T,r.returns)===-1)?new TypeError(q('1RD4S',"returns",T.join('", "'),r.returns)):null):new TypeError(q('1RD2V',e));}C.exports=D
3
+ });var V=h(function(ee,j){
4
+ var G=require("debug"),w=require('@stdlib/assert-has-own-property/dist'),m=G("group-by-async:limit");function H(r,e,i,l){var f,g,o,v,u,c,t,b;if(u=r.length,m("Collection length: %d",u),t={},u===0)return m("Finished processing a collection."),l(null,t);for(u<e.limit?v=u:v=e.limit,m("Concurrency limit: %d",v),m("Number of arguments: %d",i.length),f=u-1,g=0,c=-1,b=0;b<v;b++)c<f&&A();function A(){var n,s;c+=1,s=c,n=r[s],m("Collection element %d: %s.",s,JSON.stringify(n)),i.length===2?i.call(e.thisArg,n,d):i.length===3?i.call(e.thisArg,n,s,d):i.call(e.thisArg,n,s,r,d);function d(P,a){if(!o){if(P)return o=!0,E(P);m("Collection element %d group: %s.",s,a),e.returns==="indices"?w(t,a)?t[a].push(s):t[a]=[s]:e.returns==="*"?w(t,a)?t[a].push([s,n]):t[a]=[[s,n]]:w(t,a)?t[a].push(n):t[a]=[n],E()}}}function E(n){if(n)return m("Encountered an error: %s",n.message),l(n);if(g+=1,m("Processed %d of %d collection elements.",g,u),c<f)return A();if(g===u)return m("Finished processing a collection."),l(null,t)}}j.exports=H
5
+ });var O=h(function(re,I){
6
+ var B=require('@stdlib/assert-is-function/dist'),K=require('@stdlib/assert-is-collection/dist'),x=require('@stdlib/error-tools-fmtprodmsg/dist'),M=require('@stdlib/constants-float64-pinf/dist'),Q=F(),U=V();function W(r,e){var i,l,f;if(i={},arguments.length>1){if(l=Q(i,r),l)throw l;f=e}else f=r;if(!B(f))throw new TypeError(x('1RD3q',f));return i.series?i.limit=1:i.limit||(i.limit=M),g;function g(o,v){if(!K(o))throw new TypeError(x('1RDAh',o));if(!B(v))throw new TypeError(x('1RD3q',v));return U(o,i,f,u);function u(c,t){if(c)return v(c);v(null,t)}}}I.exports=W
7
+ });var L=h(function(ie,k){
8
+ var N=O();function X(r,e,i,l){if(arguments.length<4)return N(e)(r,i);N(e,i)(r,l)}k.exports=X
9
+ });var Y=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),J=L(),Z=O();Y(J,"factory",Z);module.exports=J;
10
+ /** @license Apache-2.0 */
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../lib/validate.js", "../lib/limit.js", "../lib/factory.js", "../lib/main.js", "../lib/index.js"],
4
+ "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert-is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert-is-positive-integer' ).isPrimitive;\nvar indexOf = require( '@stdlib/utils-index-of' );\nvar format = require( '@stdlib/string-format' );\n\n\n// VARIABLES //\n\nvar returns = [ 'values', 'indices', '*' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {string} [options.returns] - output format\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'thisArg': {},\n* 'series': false,\n* 'limit': 10,\n* 'returns': '*'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'thisArg' ) ) {\n\t\topts.thisArg = options.thisArg;\n\t}\n\tif ( hasOwnProp( options, 'series' ) ) {\n\t\topts.series = options.series;\n\t\tif ( !isBoolean( opts.series ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'series', opts.series ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'limit' ) ) {\n\t\topts.limit = options.limit;\n\t\tif ( !isPositiveInteger( opts.limit ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'limit', opts.limit ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'returns' ) ) {\n\t\topts.returns = options.returns;\n\t\tif ( indexOf( returns, opts.returns ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'returns', returns.join( '\", \"' ), opts.returns ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\n\n\n// VARIABLES //\n\nvar debug = logger( 'group-by-async:limit' );\n\n\n// MAIN //\n\n/**\n* Invokes an indicator function once for each element in a collection, limiting the number of concurrently pending functions.\n*\n* ## Notes\n*\n* - We need to cache the collection value to prevent the edge case where, during the invocation of the indicator function, the element at index `i` is swapped for some other value. For some, that might be a feature; here, we take the stance that one should be less clever.\n* - Checking for an \"own\" property is necessary to guard against the edge case where an indicator function returns a group identifier which matches a method or property on the `Object` prototype.\n*\n* @private\n* @param {Collection} collection - input collection\n* @param {Options} opts - function options\n* @param {*} [opts.thisArg] - execution context\n* @param {PositiveInteger} [opts.limit] - maximum number of pending function invocations\n* @param {string} [options.returns] - output format\n* @param {Function} indicator - indicator function\n* @param {Callback} done - function to invoke upon completion or upon encountering an error\n* @returns {void}\n*/\nfunction limit( collection, opts, indicator, done ) {\n\tvar maxIndex;\n\tvar count;\n\tvar flg;\n\tvar lim;\n\tvar len;\n\tvar idx;\n\tvar out;\n\tvar i;\n\n\tlen = collection.length;\n\tdebug( 'Collection length: %d', len );\n\n\tout = {};\n\tif ( len === 0 ) {\n\t\tdebug( 'Finished processing a collection.' );\n\t\treturn done( null, out );\n\t}\n\tif ( len < opts.limit ) {\n\t\tlim = len;\n\t} else {\n\t\tlim = opts.limit;\n\t}\n\tdebug( 'Concurrency limit: %d', lim );\n\tdebug( 'Number of arguments: %d', indicator.length );\n\n\tmaxIndex = len - 1;\n\tcount = 0;\n\tidx = -1;\n\tfor ( i = 0; i < lim; i++ ) {\n\t\t// This guard is necessary to protect against synchronous functions which exhaust all collection elements...\n\t\tif ( idx < maxIndex ) {\n\t\t\tnext(); // eslint-disable-line node/callback-return\n\t\t}\n\t}\n\t/**\n\t* Callback to invoke a provided function for the next element in a collection.\n\t*\n\t* @private\n\t*/\n\tfunction next() {\n\t\tvar v;\n\t\tvar j;\n\n\t\tidx += 1;\n\t\tj = idx;\n\t\tv = collection[ j ];\n\n\t\tdebug( 'Collection element %d: %s.', j, JSON.stringify( v ) );\n\t\tif ( indicator.length === 2 ) {\n\t\t\tindicator.call( opts.thisArg, v, cb );\n\t\t} else if ( indicator.length === 3 ) {\n\t\t\tindicator.call( opts.thisArg, v, j, cb );\n\t\t} else {\n\t\t\tindicator.call( opts.thisArg, v, j, collection, cb );\n\t\t}\n\t\t/**\n\t\t* Callback invoked once a provided function finishes processing a collection element.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {*} [group] - group\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction cb( error, group ) {\n\t\t\tif ( flg ) {\n\t\t\t\t// Prevent further processing of collection elements:\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( error ) {\n\t\t\t\tflg = true;\n\t\t\t\treturn clbk( error );\n\t\t\t}\n\t\t\tdebug( 'Collection element %d group: %s.', j, group );\n\n\t\t\t// Default is to return values...\n\t\t\tif ( opts.returns === 'indices' ) {\n\t\t\t\tif ( hasOwnProp( out, group ) ) {\n\t\t\t\t\tout[ group ].push( j );\n\t\t\t\t} else {\n\t\t\t\t\tout[ group ] = [ j ];\n\t\t\t\t}\n\t\t\t} else if ( opts.returns === '*' ) {\n\t\t\t\tif ( hasOwnProp( out, group ) ) {\n\t\t\t\t\tout[ group ].push( [ j, v ] );\n\t\t\t\t} else {\n\t\t\t\t\tout[ group ] = [ [ j, v ] ];\n\t\t\t\t}\n\t\t\t} else if ( hasOwnProp( out, group ) ) {\n\t\t\t\tout[ group ].push( v );\n\t\t\t} else {\n\t\t\t\tout[ group ] = [ v ];\n\t\t\t}\n\t\t\tclbk();\n\t\t}\n\t}\n\n\t/**\n\t* Callback invoked once ready to process the next collection element.\n\t*\n\t* @private\n\t* @param {*} [error] - error\n\t* @returns {void}\n\t*/\n\tfunction clbk( error ) {\n\t\tif ( error ) {\n\t\t\tdebug( 'Encountered an error: %s', error.message );\n\t\t\treturn done( error );\n\t\t}\n\t\tcount += 1;\n\t\tdebug( 'Processed %d of %d collection elements.', count, len );\n\t\tif ( idx < maxIndex ) {\n\t\t\treturn next();\n\t\t}\n\t\tif ( count === len ) {\n\t\t\tdebug( 'Finished processing a collection.' );\n\t\t\treturn done( null, out );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = limit;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar isCollection = require( '@stdlib/assert-is-collection' );\nvar format = require( '@stdlib/string-format' );\nvar PINF = require( '@stdlib/constants-float64-pinf' );\nvar validate = require( './validate.js' );\nvar limit = require( './limit.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for grouping values according to an indicator function.\n*\n* ## Notes\n*\n* - 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`).\n*\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} last argument must be a function\n* @returns {Function} function which invokes the indicator function once for each element in a collection\n*\n* @example\n* var readFile = require( '@stdlib/fs-read-file' );\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* var opts = {\n* 'series': true\n* };\n*\n* // Create a `groupByAsync` function which invokes the indicator function for each collection element sequentially:\n* var groupByAsync = factory( opts, indicator );\n*\n* // Create a collection over which to iterate:\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* // Define a callback which handles results:\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* // Try to read each element in `files`:\n* groupByAsync( files, done );\n*/\nfunction factory( options, indicator ) {\n\tvar opts;\n\tvar err;\n\tvar f;\n\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tf = indicator;\n\t} else {\n\t\tf = options;\n\t}\n\tif ( !isFunction( f ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', f ) );\n\t}\n\tif ( opts.series ) {\n\t\topts.limit = 1;\n\t} else if ( !opts.limit ) {\n\t\topts.limit = PINF;\n\t}\n\treturn groupByAsync;\n\n\t/**\n\t* Invokes an indicator function for each element in a collection.\n\t*\n\t* @private\n\t* @param {Collection} collection - input collection\n\t* @param {Callback} done - function to invoke upon completion\n\t* @throws {TypeError} first argument must be a collection\n\t* @throws {TypeError} last argument must be a function\n\t* @returns {void}\n\t*/\n\tfunction groupByAsync( collection, done ) {\n\t\tif ( !isCollection( collection ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );\n\t\t}\n\t\tif ( !isFunction( done ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', done ) );\n\t\t}\n\t\treturn limit( collection, opts, f, clbk );\n\n\t\t/**\n\t\t* Callback invoked upon completion.\n\t\t*\n\t\t* @private\n\t\t* @param {*} [error] - error\n\t\t* @param {Object} result - group-by result\n\t\t* @returns {void}\n\t\t*/\n\t\tfunction clbk( error, result ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn done( error );\n\t\t\t}\n\t\t\tdone( null, result );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Groups values according to an indicator function.\n*\n* ## Notes\n*\n* - 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`).\n*\n* @param {Collection} collection - input collection\n* @param {Options} [options] - function options\n* @param {*} [options.thisArg] - execution context\n* @param {PositiveInteger} [options.limit] - maximum number of pending invocations at any one time\n* @param {boolean} [options.series=false] - boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection\n* @param {string} [options.returns=\"values\"] - if `values`, values are returned; if `indices`, indices are returned; if `*`, both indices and values are returned\n* @param {Function} indicator - indicator function specifying which group an element in the input collection belongs to\n* @param {Callback} done - function to invoke upon completion\n* @throws {TypeError} first argument must be a collection\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} second-to-last argument must be a function\n* @throws {TypeError} last argument must be a function\n* @returns {void}\n*\n* @example\n* var readFile = require( '@stdlib/fs-read-file' );\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* groupByAsync( files, indicator, done );\n*/\nfunction groupByAsync( collection, options, indicator, done ) {\n\tif ( arguments.length < 4 ) {\n\t\treturn factory( options )( collection, indicator );\n\t}\n\tfactory( options, indicator )( collection, done );\n}\n\n\n// EXPORTS //\n\nmodule.exports = groupByAsync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Group values according to an indicator function.\n*\n* @module @stdlib/utils-async-group-by\n*\n* @example\n* var readFile = require( '@stdlib/fs-read-file' );\n* var groupByAsync = require( '@stdlib/utils-async-group-by' );\n*\n* var files = [\n* './beep.js',\n* './boop.js'\n* ];\n*\n* function done( error, result ) {\n* if ( error ) {\n* throw error;\n* }\n* console.log( result );\n* }\n*\n* function indicator( file, next ) {\n* var opts = {\n* 'encoding': 'utf8'\n* };\n* readFile( file, opts, onFile );\n*\n* function onFile( error ) {\n* if ( error ) {\n* return next( null, 'nonreadable' );\n* }\n* next( null, 'readable' );\n* }\n* }\n*\n* groupByAsync( files, indicator, done );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
+ "mappings": "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",
6
+ "names": ["require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isPositiveInteger", "indexOf", "format", "returns", "validate", "opts", "options", "require_limit", "__commonJSMin", "exports", "module", "logger", "hasOwnProp", "debug", "limit", "collection", "opts", "indicator", "done", "maxIndex", "count", "flg", "lim", "len", "idx", "out", "i", "next", "v", "j", "cb", "error", "group", "clbk", "require_factory", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "format", "PINF", "validate", "limit", "factory", "options", "indicator", "opts", "err", "groupByAsync", "collection", "done", "clbk", "error", "result", "require_main", "__commonJSMin", "exports", "module", "factory", "groupByAsync", "collection", "options", "indicator", "done", "setReadOnly", "main", "factory"]
7
+ }