@stdlib/utils-async 0.3.0 → 0.4.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/NOTICE +1 -1
- package/README.md +8 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/docs/types/index.d.ts +74 -0
- package/lib/index.js +9 -0
- package/package.json +2 -1
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2026 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -88,6 +88,7 @@ var o = ns;
|
|
|
88
88
|
- <span class="signature">[`mapValuesAsync( obj, [options,] transform, done )`][@stdlib/utils/async/map-values]</span><span class="delimiter">: </span><span class="description">map values from one object to a new object having the same keys.</span>
|
|
89
89
|
- <span class="signature">[`noneByRightAsync( collection, [options,] predicate, done )`][@stdlib/utils/async/none-by-right]</span><span class="delimiter">: </span><span class="description">test whether all elements in a collection fail a test implemented by a predicate function, iterating from right to left.</span>
|
|
90
90
|
- <span class="signature">[`noneByAsync( collection, [options,] predicate, done )`][@stdlib/utils/async/none-by]</span><span class="delimiter">: </span><span class="description">test whether all elements in a collection fail a test implemented by a predicate function.</span>
|
|
91
|
+
- <span class="signature">[`parallel( fcns, [options,] done )`][@stdlib/utils/async/parallel]</span><span class="delimiter">: </span><span class="description">execute functions in parallel and pass the results of all functions to a provided callback.</span>
|
|
91
92
|
- <span class="signature">[`reduceRightAsync( collection, initial, [options,] reducer, done )`][@stdlib/utils/async/reduce-right]</span><span class="delimiter">: </span><span class="description">apply a function against an accumulator and each element in a collection and return the accumulated result, iterating from right to left.</span>
|
|
92
93
|
- <span class="signature">[`reduceAsync( collection, initial, [options,] reducer, done )`][@stdlib/utils/async/reduce]</span><span class="delimiter">: </span><span class="description">apply a function against an accumulator and each element in a collection and return the accumulated result.</span>
|
|
93
94
|
- <span class="signature">[`waterfall( fcns, clbk[, thisArg] )`][@stdlib/utils/async/series-waterfall]</span><span class="delimiter">: </span><span class="description">execute functions in series, passing the results of one function as arguments to the next function.</span>
|
|
@@ -160,7 +161,7 @@ See [LICENSE][stdlib-license].
|
|
|
160
161
|
|
|
161
162
|
## Copyright
|
|
162
163
|
|
|
163
|
-
Copyright © 2016-
|
|
164
|
+
Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
|
|
164
165
|
|
|
165
166
|
</section>
|
|
166
167
|
|
|
@@ -173,8 +174,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
173
174
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/utils-async.svg
|
|
174
175
|
[npm-url]: https://npmjs.org/package/@stdlib/utils-async
|
|
175
176
|
|
|
176
|
-
[test-image]: https://github.com/stdlib-js/utils-async/actions/workflows/test.yml/badge.svg?branch=v0.
|
|
177
|
-
[test-url]: https://github.com/stdlib-js/utils-async/actions/workflows/test.yml?query=branch:v0.
|
|
177
|
+
[test-image]: https://github.com/stdlib-js/utils-async/actions/workflows/test.yml/badge.svg?branch=v0.4.0
|
|
178
|
+
[test-url]: https://github.com/stdlib-js/utils-async/actions/workflows/test.yml?query=branch:v0.4.0
|
|
178
179
|
|
|
179
180
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/utils-async/main.svg
|
|
180
181
|
[coverage-url]: https://codecov.io/github/stdlib-js/utils-async?branch=main
|
|
@@ -186,8 +187,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
186
187
|
|
|
187
188
|
-->
|
|
188
189
|
|
|
189
|
-
[chat-image]: https://img.shields.io/
|
|
190
|
-
[chat-url]: https://
|
|
190
|
+
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
|
|
191
|
+
[chat-url]: https://stdlib.zulipchat.com
|
|
191
192
|
|
|
192
193
|
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
193
194
|
|
|
@@ -252,6 +253,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
252
253
|
|
|
253
254
|
[@stdlib/utils/async/none-by]: https://www.npmjs.com/package/@stdlib/utils-async-none-by
|
|
254
255
|
|
|
256
|
+
[@stdlib/utils/async/parallel]: https://www.npmjs.com/package/@stdlib/utils-async-parallel
|
|
257
|
+
|
|
255
258
|
[@stdlib/utils/async/reduce-right]: https://www.npmjs.com/package/@stdlib/utils-async-reduce-right
|
|
256
259
|
|
|
257
260
|
[@stdlib/utils/async/reduce]: https://www.npmjs.com/package/@stdlib/utils-async-reduce
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var r=require('@stdlib/utils-define-read-only-property/dist'),e={};r(e,"anyByAsync",require('@stdlib/utils-async-any-by/dist'));r(e,"anyByRightAsync",require('@stdlib/utils-async-any-by-right/dist'));r(e,"bifurcateByAsync",require('@stdlib/utils-async-bifurcate-by/dist'));r(e,"composeAsync",require('@stdlib/utils-async-compose/dist'));r(e,"countByAsync",require('@stdlib/utils-async-count-by/dist'));r(e,"doUntilAsync",require('@stdlib/utils-async-do-until/dist'));r(e,"doWhileAsync",require('@stdlib/utils-async-do-while/dist'));r(e,"everyByAsync",require('@stdlib/utils-async-every-by/dist'));r(e,"everyByRightAsync",require('@stdlib/utils-async-every-by-right/dist'));r(e,"forEachAsync",require('@stdlib/utils-async-for-each/dist'));r(e,"forEachRightAsync",require('@stdlib/utils-async-for-each-right/dist'));r(e,"functionSequenceAsync",require('@stdlib/utils-async-function-sequence/dist'));r(e,"groupByAsync",require('@stdlib/utils-async-group-by/dist'));r(e,"ifelseAsync",require('@stdlib/utils-async-if-else/dist'));r(e,"ifthenAsync",require('@stdlib/utils-async-if-then/dist'));r(e,"inmapAsync",require('@stdlib/utils-async-inmap/dist'));r(e,"inmapRightAsync",require('@stdlib/utils-async-inmap-right/dist'));r(e,"mapFunAsync",require('@stdlib/utils-async-map-function/dist'));r(e,"mapKeysAsync",require('@stdlib/utils-async-map-keys/dist'));r(e,"mapValuesAsync",require('@stdlib/utils-async-map-values/dist'));r(e,"noneByAsync",require('@stdlib/utils-async-none-by/dist'));r(e,"noneByRightAsync",require('@stdlib/utils-async-none-by-right/dist'));r(e,"reduceAsync",require('@stdlib/utils-async-reduce/dist'));r(e,"reduceRightAsync",require('@stdlib/utils-async-reduce-right/dist'));r(e,"waterfall",require('@stdlib/utils-async-series-waterfall/dist'));r(e,"someByAsync",require('@stdlib/utils-async-some-by/dist'));r(e,"someByRightAsync",require('@stdlib/utils-async-some-by-right/dist'));r(e,"tabulateByAsync",require('@stdlib/utils-async-tabulate-by/dist'));r(e,"trycatchAsync",require('@stdlib/utils-async-try-catch/dist'));r(e,"trythenAsync",require('@stdlib/utils-async-try-then/dist'));r(e,"untilAsync",require('@stdlib/utils-async-until/dist'));r(e,"whileAsync",require('@stdlib/utils-async-while/dist'));module.exports=e;
|
|
1
|
+
"use strict";var r=require('@stdlib/utils-define-read-only-property/dist'),e={};r(e,"anyByAsync",require('@stdlib/utils-async-any-by/dist'));r(e,"anyByRightAsync",require('@stdlib/utils-async-any-by-right/dist'));r(e,"bifurcateByAsync",require('@stdlib/utils-async-bifurcate-by/dist'));r(e,"composeAsync",require('@stdlib/utils-async-compose/dist'));r(e,"countByAsync",require('@stdlib/utils-async-count-by/dist'));r(e,"doUntilAsync",require('@stdlib/utils-async-do-until/dist'));r(e,"doWhileAsync",require('@stdlib/utils-async-do-while/dist'));r(e,"everyByAsync",require('@stdlib/utils-async-every-by/dist'));r(e,"everyByRightAsync",require('@stdlib/utils-async-every-by-right/dist'));r(e,"forEachAsync",require('@stdlib/utils-async-for-each/dist'));r(e,"forEachRightAsync",require('@stdlib/utils-async-for-each-right/dist'));r(e,"functionSequenceAsync",require('@stdlib/utils-async-function-sequence/dist'));r(e,"groupByAsync",require('@stdlib/utils-async-group-by/dist'));r(e,"ifelseAsync",require('@stdlib/utils-async-if-else/dist'));r(e,"ifthenAsync",require('@stdlib/utils-async-if-then/dist'));r(e,"inmapAsync",require('@stdlib/utils-async-inmap/dist'));r(e,"inmapRightAsync",require('@stdlib/utils-async-inmap-right/dist'));r(e,"mapFunAsync",require('@stdlib/utils-async-map-function/dist'));r(e,"mapKeysAsync",require('@stdlib/utils-async-map-keys/dist'));r(e,"mapValuesAsync",require('@stdlib/utils-async-map-values/dist'));r(e,"noneByAsync",require('@stdlib/utils-async-none-by/dist'));r(e,"noneByRightAsync",require('@stdlib/utils-async-none-by-right/dist'));r(e,"parallel",require('@stdlib/utils-async-parallel/dist'));r(e,"reduceAsync",require('@stdlib/utils-async-reduce/dist'));r(e,"reduceRightAsync",require('@stdlib/utils-async-reduce-right/dist'));r(e,"waterfall",require('@stdlib/utils-async-series-waterfall/dist'));r(e,"someByAsync",require('@stdlib/utils-async-some-by/dist'));r(e,"someByRightAsync",require('@stdlib/utils-async-some-by-right/dist'));r(e,"tabulateByAsync",require('@stdlib/utils-async-tabulate-by/dist'));r(e,"trycatchAsync",require('@stdlib/utils-async-try-catch/dist'));r(e,"trythenAsync",require('@stdlib/utils-async-try-then/dist'));r(e,"untilAsync",require('@stdlib/utils-async-until/dist'));r(e,"whileAsync",require('@stdlib/utils-async-while/dist'));module.exports=e;
|
|
2
2
|
/** @license Apache-2.0 */
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../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/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name anyByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/any-by}\n*/\nsetReadOnly( ns, 'anyByAsync', require( '@stdlib/utils-async-any-by' ) );\n\n/**\n* @name anyByRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/any-by-right}\n*/\nsetReadOnly( ns, 'anyByRightAsync', require( '@stdlib/utils-async-any-by-right' ) );\n\n/**\n* @name bifurcateByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/bifurcate-by}\n*/\nsetReadOnly( ns, 'bifurcateByAsync', require( '@stdlib/utils-async-bifurcate-by' ) );\n\n/**\n* @name composeAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/compose}\n*/\nsetReadOnly( ns, 'composeAsync', require( '@stdlib/utils-async-compose' ) );\n\n/**\n* @name countByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/count-by}\n*/\nsetReadOnly( ns, 'countByAsync', require( '@stdlib/utils-async-count-by' ) );\n\n/**\n* @name doUntilAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/do-until}\n*/\nsetReadOnly( ns, 'doUntilAsync', require( '@stdlib/utils-async-do-until' ) );\n\n/**\n* @name doWhileAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/do-while}\n*/\nsetReadOnly( ns, 'doWhileAsync', require( '@stdlib/utils-async-do-while' ) );\n\n/**\n* @name everyByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/every-by}\n*/\nsetReadOnly( ns, 'everyByAsync', require( '@stdlib/utils-async-every-by' ) );\n\n/**\n* @name everyByRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/every-by-right}\n*/\nsetReadOnly( ns, 'everyByRightAsync', require( '@stdlib/utils-async-every-by-right' ) );\n\n/**\n* @name forEachAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/for-each}\n*/\nsetReadOnly( ns, 'forEachAsync', require( '@stdlib/utils-async-for-each' ) );\n\n/**\n* @name forEachRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/for-each-right}\n*/\nsetReadOnly( ns, 'forEachRightAsync', require( '@stdlib/utils-async-for-each-right' ) );\n\n/**\n* @name functionSequenceAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/function-sequence}\n*/\nsetReadOnly( ns, 'functionSequenceAsync', require( '@stdlib/utils-async-function-sequence' ) );\n\n/**\n* @name groupByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/group-by}\n*/\nsetReadOnly( ns, 'groupByAsync', require( '@stdlib/utils-async-group-by' ) );\n\n/**\n* @name ifelseAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/if-else}\n*/\nsetReadOnly( ns, 'ifelseAsync', require( '@stdlib/utils-async-if-else' ) );\n\n/**\n* @name ifthenAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/if-then}\n*/\nsetReadOnly( ns, 'ifthenAsync', require( '@stdlib/utils-async-if-then' ) );\n\n/**\n* @name inmapAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/inmap}\n*/\nsetReadOnly( ns, 'inmapAsync', require( '@stdlib/utils-async-inmap' ) );\n\n/**\n* @name inmapRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/inmap-right}\n*/\nsetReadOnly( ns, 'inmapRightAsync', require( '@stdlib/utils-async-inmap-right' ) );\n\n/**\n* @name mapFunAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/map-function}\n*/\nsetReadOnly( ns, 'mapFunAsync', require( '@stdlib/utils-async-map-function' ) );\n\n/**\n* @name mapKeysAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/map-keys}\n*/\nsetReadOnly( ns, 'mapKeysAsync', require( '@stdlib/utils-async-map-keys' ) );\n\n/**\n* @name mapValuesAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/map-values}\n*/\nsetReadOnly( ns, 'mapValuesAsync', require( '@stdlib/utils-async-map-values' ) );\n\n/**\n* @name noneByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/none-by}\n*/\nsetReadOnly( ns, 'noneByAsync', require( '@stdlib/utils-async-none-by' ) );\n\n/**\n* @name noneByRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/none-by-right}\n*/\nsetReadOnly( ns, 'noneByRightAsync', require( '@stdlib/utils-async-none-by-right' ) );\n\n/**\n* @name reduceAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/reduce}\n*/\nsetReadOnly( ns, 'reduceAsync', require( '@stdlib/utils-async-reduce' ) );\n\n/**\n* @name reduceRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/reduce-right}\n*/\nsetReadOnly( ns, 'reduceRightAsync', require( '@stdlib/utils-async-reduce-right' ) );\n\n/**\n* @name waterfall\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/series-waterfall}\n*/\nsetReadOnly( ns, 'waterfall', require( '@stdlib/utils-async-series-waterfall' ) );\n\n/**\n* @name someByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/some-by}\n*/\nsetReadOnly( ns, 'someByAsync', require( '@stdlib/utils-async-some-by' ) );\n\n/**\n* @name someByRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/some-by-right}\n*/\nsetReadOnly( ns, 'someByRightAsync', require( '@stdlib/utils-async-some-by-right' ) );\n\n/**\n* @name tabulateByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/tabulate-by}\n*/\nsetReadOnly( ns, 'tabulateByAsync', require( '@stdlib/utils-async-tabulate-by' ) );\n\n/**\n* @name trycatchAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/try-catch}\n*/\nsetReadOnly( ns, 'trycatchAsync', require( '@stdlib/utils-async-try-catch' ) );\n\n/**\n* @name trythenAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/try-then}\n*/\nsetReadOnly( ns, 'trythenAsync', require( '@stdlib/utils-async-try-then' ) );\n\n/**\n* @name untilAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/until}\n*/\nsetReadOnly( ns, 'untilAsync', require( '@stdlib/utils-async-until' ) );\n\n/**\n* @name whileAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/while}\n*/\nsetReadOnly( ns, 'whileAsync', require( '@stdlib/utils-async-while' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n"],
|
|
5
|
-
"mappings": "aA0BA,IAAIA,EAAc,QAAS,yCAA0C,EAUjEC,EAAK,CAAC,EASVD,EAAaC,EAAI,aAAc,QAAS,4BAA6B,CAAE,EASvED,EAAaC,EAAI,kBAAmB,QAAS,kCAAmC,CAAE,EASlFD,EAAaC,EAAI,mBAAoB,QAAS,kCAAmC,CAAE,EASnFD,EAAaC,EAAI,eAAgB,QAAS,6BAA8B,CAAE,EAS1ED,EAAaC,EAAI,eAAgB,QAAS,8BAA+B,CAAE,EAS3ED,EAAaC,EAAI,eAAgB,QAAS,8BAA+B,CAAE,EAS3ED,EAAaC,EAAI,eAAgB,QAAS,8BAA+B,CAAE,EAS3ED,EAAaC,EAAI,eAAgB,QAAS,8BAA+B,CAAE,EAS3ED,EAAaC,EAAI,oBAAqB,QAAS,oCAAqC,CAAE,EAStFD,EAAaC,EAAI,eAAgB,QAAS,8BAA+B,CAAE,EAS3ED,EAAaC,EAAI,oBAAqB,QAAS,oCAAqC,CAAE,EAStFD,EAAaC,EAAI,wBAAyB,QAAS,uCAAwC,CAAE,EAS7FD,EAAaC,EAAI,eAAgB,QAAS,8BAA+B,CAAE,EAS3ED,EAAaC,EAAI,cAAe,QAAS,6BAA8B,CAAE,EASzED,EAAaC,EAAI,cAAe,QAAS,6BAA8B,CAAE,EASzED,EAAaC,EAAI,aAAc,QAAS,2BAA4B,CAAE,EAStED,EAAaC,EAAI,kBAAmB,QAAS,iCAAkC,CAAE,EASjFD,EAAaC,EAAI,cAAe,QAAS,kCAAmC,CAAE,EAS9ED,EAAaC,EAAI,eAAgB,QAAS,8BAA+B,CAAE,EAS3ED,EAAaC,EAAI,iBAAkB,QAAS,gCAAiC,CAAE,EAS/ED,EAAaC,EAAI,cAAe,QAAS,6BAA8B,CAAE,EASzED,EAAaC,EAAI,mBAAoB,QAAS,mCAAoC,CAAE,EASpFD,EAAaC,EAAI,cAAe,QAAS,4BAA6B,CAAE,EASxED,EAAaC,EAAI,mBAAoB,QAAS,kCAAmC,CAAE,EASnFD,EAAaC,EAAI,YAAa,QAAS,sCAAuC,CAAE,EAShFD,EAAaC,EAAI,cAAe,QAAS,6BAA8B,CAAE,EASzED,EAAaC,EAAI,mBAAoB,QAAS,mCAAoC,CAAE,EASpFD,EAAaC,EAAI,kBAAmB,QAAS,iCAAkC,CAAE,EASjFD,EAAaC,EAAI,gBAAiB,QAAS,+BAAgC,CAAE,EAS7ED,EAAaC,EAAI,eAAgB,QAAS,8BAA+B,CAAE,EAS3ED,EAAaC,EAAI,aAAc,QAAS,2BAA4B,CAAE,EAStED,EAAaC,EAAI,aAAc,QAAS,2BAA4B,CAAE,EAKtE,OAAO,QAAUA",
|
|
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/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name anyByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/any-by}\n*/\nsetReadOnly( ns, 'anyByAsync', require( '@stdlib/utils-async-any-by' ) );\n\n/**\n* @name anyByRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/any-by-right}\n*/\nsetReadOnly( ns, 'anyByRightAsync', require( '@stdlib/utils-async-any-by-right' ) );\n\n/**\n* @name bifurcateByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/bifurcate-by}\n*/\nsetReadOnly( ns, 'bifurcateByAsync', require( '@stdlib/utils-async-bifurcate-by' ) );\n\n/**\n* @name composeAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/compose}\n*/\nsetReadOnly( ns, 'composeAsync', require( '@stdlib/utils-async-compose' ) );\n\n/**\n* @name countByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/count-by}\n*/\nsetReadOnly( ns, 'countByAsync', require( '@stdlib/utils-async-count-by' ) );\n\n/**\n* @name doUntilAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/do-until}\n*/\nsetReadOnly( ns, 'doUntilAsync', require( '@stdlib/utils-async-do-until' ) );\n\n/**\n* @name doWhileAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/do-while}\n*/\nsetReadOnly( ns, 'doWhileAsync', require( '@stdlib/utils-async-do-while' ) );\n\n/**\n* @name everyByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/every-by}\n*/\nsetReadOnly( ns, 'everyByAsync', require( '@stdlib/utils-async-every-by' ) );\n\n/**\n* @name everyByRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/every-by-right}\n*/\nsetReadOnly( ns, 'everyByRightAsync', require( '@stdlib/utils-async-every-by-right' ) );\n\n/**\n* @name forEachAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/for-each}\n*/\nsetReadOnly( ns, 'forEachAsync', require( '@stdlib/utils-async-for-each' ) );\n\n/**\n* @name forEachRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/for-each-right}\n*/\nsetReadOnly( ns, 'forEachRightAsync', require( '@stdlib/utils-async-for-each-right' ) );\n\n/**\n* @name functionSequenceAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/function-sequence}\n*/\nsetReadOnly( ns, 'functionSequenceAsync', require( '@stdlib/utils-async-function-sequence' ) );\n\n/**\n* @name groupByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/group-by}\n*/\nsetReadOnly( ns, 'groupByAsync', require( '@stdlib/utils-async-group-by' ) );\n\n/**\n* @name ifelseAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/if-else}\n*/\nsetReadOnly( ns, 'ifelseAsync', require( '@stdlib/utils-async-if-else' ) );\n\n/**\n* @name ifthenAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/if-then}\n*/\nsetReadOnly( ns, 'ifthenAsync', require( '@stdlib/utils-async-if-then' ) );\n\n/**\n* @name inmapAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/inmap}\n*/\nsetReadOnly( ns, 'inmapAsync', require( '@stdlib/utils-async-inmap' ) );\n\n/**\n* @name inmapRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/inmap-right}\n*/\nsetReadOnly( ns, 'inmapRightAsync', require( '@stdlib/utils-async-inmap-right' ) );\n\n/**\n* @name mapFunAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/map-function}\n*/\nsetReadOnly( ns, 'mapFunAsync', require( '@stdlib/utils-async-map-function' ) );\n\n/**\n* @name mapKeysAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/map-keys}\n*/\nsetReadOnly( ns, 'mapKeysAsync', require( '@stdlib/utils-async-map-keys' ) );\n\n/**\n* @name mapValuesAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/map-values}\n*/\nsetReadOnly( ns, 'mapValuesAsync', require( '@stdlib/utils-async-map-values' ) );\n\n/**\n* @name noneByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/none-by}\n*/\nsetReadOnly( ns, 'noneByAsync', require( '@stdlib/utils-async-none-by' ) );\n\n/**\n* @name noneByRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/none-by-right}\n*/\nsetReadOnly( ns, 'noneByRightAsync', require( '@stdlib/utils-async-none-by-right' ) );\n\n/**\n* @name parallel\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/parallel}\n*/\nsetReadOnly( ns, 'parallel', require( '@stdlib/utils-async-parallel' ) );\n\n/**\n* @name reduceAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/reduce}\n*/\nsetReadOnly( ns, 'reduceAsync', require( '@stdlib/utils-async-reduce' ) );\n\n/**\n* @name reduceRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/reduce-right}\n*/\nsetReadOnly( ns, 'reduceRightAsync', require( '@stdlib/utils-async-reduce-right' ) );\n\n/**\n* @name waterfall\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/series-waterfall}\n*/\nsetReadOnly( ns, 'waterfall', require( '@stdlib/utils-async-series-waterfall' ) );\n\n/**\n* @name someByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/some-by}\n*/\nsetReadOnly( ns, 'someByAsync', require( '@stdlib/utils-async-some-by' ) );\n\n/**\n* @name someByRightAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/some-by-right}\n*/\nsetReadOnly( ns, 'someByRightAsync', require( '@stdlib/utils-async-some-by-right' ) );\n\n/**\n* @name tabulateByAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/tabulate-by}\n*/\nsetReadOnly( ns, 'tabulateByAsync', require( '@stdlib/utils-async-tabulate-by' ) );\n\n/**\n* @name trycatchAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/try-catch}\n*/\nsetReadOnly( ns, 'trycatchAsync', require( '@stdlib/utils-async-try-catch' ) );\n\n/**\n* @name trythenAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/try-then}\n*/\nsetReadOnly( ns, 'trythenAsync', require( '@stdlib/utils-async-try-then' ) );\n\n/**\n* @name untilAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/until}\n*/\nsetReadOnly( ns, 'untilAsync', require( '@stdlib/utils-async-until' ) );\n\n/**\n* @name whileAsync\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/utils/async/while}\n*/\nsetReadOnly( ns, 'whileAsync', require( '@stdlib/utils-async-while' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n"],
|
|
5
|
+
"mappings": "aA0BA,IAAIA,EAAc,QAAS,yCAA0C,EAUjEC,EAAK,CAAC,EASVD,EAAaC,EAAI,aAAc,QAAS,4BAA6B,CAAE,EASvED,EAAaC,EAAI,kBAAmB,QAAS,kCAAmC,CAAE,EASlFD,EAAaC,EAAI,mBAAoB,QAAS,kCAAmC,CAAE,EASnFD,EAAaC,EAAI,eAAgB,QAAS,6BAA8B,CAAE,EAS1ED,EAAaC,EAAI,eAAgB,QAAS,8BAA+B,CAAE,EAS3ED,EAAaC,EAAI,eAAgB,QAAS,8BAA+B,CAAE,EAS3ED,EAAaC,EAAI,eAAgB,QAAS,8BAA+B,CAAE,EAS3ED,EAAaC,EAAI,eAAgB,QAAS,8BAA+B,CAAE,EAS3ED,EAAaC,EAAI,oBAAqB,QAAS,oCAAqC,CAAE,EAStFD,EAAaC,EAAI,eAAgB,QAAS,8BAA+B,CAAE,EAS3ED,EAAaC,EAAI,oBAAqB,QAAS,oCAAqC,CAAE,EAStFD,EAAaC,EAAI,wBAAyB,QAAS,uCAAwC,CAAE,EAS7FD,EAAaC,EAAI,eAAgB,QAAS,8BAA+B,CAAE,EAS3ED,EAAaC,EAAI,cAAe,QAAS,6BAA8B,CAAE,EASzED,EAAaC,EAAI,cAAe,QAAS,6BAA8B,CAAE,EASzED,EAAaC,EAAI,aAAc,QAAS,2BAA4B,CAAE,EAStED,EAAaC,EAAI,kBAAmB,QAAS,iCAAkC,CAAE,EASjFD,EAAaC,EAAI,cAAe,QAAS,kCAAmC,CAAE,EAS9ED,EAAaC,EAAI,eAAgB,QAAS,8BAA+B,CAAE,EAS3ED,EAAaC,EAAI,iBAAkB,QAAS,gCAAiC,CAAE,EAS/ED,EAAaC,EAAI,cAAe,QAAS,6BAA8B,CAAE,EASzED,EAAaC,EAAI,mBAAoB,QAAS,mCAAoC,CAAE,EASpFD,EAAaC,EAAI,WAAY,QAAS,8BAA+B,CAAE,EASvED,EAAaC,EAAI,cAAe,QAAS,4BAA6B,CAAE,EASxED,EAAaC,EAAI,mBAAoB,QAAS,kCAAmC,CAAE,EASnFD,EAAaC,EAAI,YAAa,QAAS,sCAAuC,CAAE,EAShFD,EAAaC,EAAI,cAAe,QAAS,6BAA8B,CAAE,EASzED,EAAaC,EAAI,mBAAoB,QAAS,mCAAoC,CAAE,EASpFD,EAAaC,EAAI,kBAAmB,QAAS,iCAAkC,CAAE,EASjFD,EAAaC,EAAI,gBAAiB,QAAS,+BAAgC,CAAE,EAS7ED,EAAaC,EAAI,eAAgB,QAAS,8BAA+B,CAAE,EAS3ED,EAAaC,EAAI,aAAc,QAAS,2BAA4B,CAAE,EAStED,EAAaC,EAAI,aAAc,QAAS,2BAA4B,CAAE,EAKtE,OAAO,QAAUA",
|
|
6
6
|
"names": ["setReadOnly", "ns"]
|
|
7
7
|
}
|
package/docs/types/index.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ import mapKeysAsync = require( '@stdlib/utils-async-map-keys' );
|
|
|
42
42
|
import mapValuesAsync = require( '@stdlib/utils-async-map-values' );
|
|
43
43
|
import noneByAsync = require( '@stdlib/utils-async-none-by' );
|
|
44
44
|
import noneByRightAsync = require( '@stdlib/utils-async-none-by-right' );
|
|
45
|
+
import parallel = require( '@stdlib/utils-async-parallel' );
|
|
45
46
|
import reduceAsync = require( '@stdlib/utils-async-reduce' );
|
|
46
47
|
import reduceRightAsync = require( '@stdlib/utils-async-reduce-right' );
|
|
47
48
|
import waterfall = require( '@stdlib/utils-async-series-waterfall' );
|
|
@@ -1112,6 +1113,79 @@ interface Namespace {
|
|
|
1112
1113
|
*/
|
|
1113
1114
|
noneByRightAsync: typeof noneByRightAsync;
|
|
1114
1115
|
|
|
1116
|
+
/**
|
|
1117
|
+
* Executes a set of functions in parallel and passes the results of all functions to a provided callback.
|
|
1118
|
+
*
|
|
1119
|
+
* ## Notes
|
|
1120
|
+
*
|
|
1121
|
+
* - This function is intended to start asynchronous tasks so that execution of each task runs concurrently. If provided a function which does not perform asynchronous tasks, the function will execute synchronously.
|
|
1122
|
+
* - The function executes provided functions in the same thread. Accordingly, the function does **not** spawn new threads.
|
|
1123
|
+
*
|
|
1124
|
+
* @param fcns - array of functions
|
|
1125
|
+
* @param options - function options
|
|
1126
|
+
* @param options.thisArg - function context
|
|
1127
|
+
* @param options.limit - number of functions to execute concurrently
|
|
1128
|
+
* @param clbk - callback to invoke upon completion
|
|
1129
|
+
*
|
|
1130
|
+
* @example
|
|
1131
|
+
* function foo( clbk ) {
|
|
1132
|
+
* setTimeout( onTimeout, 300 );
|
|
1133
|
+
* function onTimeout() {
|
|
1134
|
+
* clbk( null, 'one' );
|
|
1135
|
+
* }
|
|
1136
|
+
* }
|
|
1137
|
+
*
|
|
1138
|
+
* function bar( clbk ) {
|
|
1139
|
+
* setTimeout( onTimeout, 100 );
|
|
1140
|
+
* function onTimeout() {
|
|
1141
|
+
* clbk( null, 'two' );
|
|
1142
|
+
* }
|
|
1143
|
+
* }
|
|
1144
|
+
*
|
|
1145
|
+
* function done( error, results ) {
|
|
1146
|
+
* if ( error ) {
|
|
1147
|
+
* throw error;
|
|
1148
|
+
* }
|
|
1149
|
+
* console.log( results );
|
|
1150
|
+
* // => [ 'one', 'two' ]
|
|
1151
|
+
* }
|
|
1152
|
+
*
|
|
1153
|
+
* var fcns = [ foo, bar ];
|
|
1154
|
+
*
|
|
1155
|
+
* ns.parallel( fcns, done );
|
|
1156
|
+
*
|
|
1157
|
+
* @example
|
|
1158
|
+
* function a( clbk ) {
|
|
1159
|
+
* setTimeout( onTimeout, 0 );
|
|
1160
|
+
* function onTimeout() {
|
|
1161
|
+
* clbk( null, 2 );
|
|
1162
|
+
* }
|
|
1163
|
+
* }
|
|
1164
|
+
*
|
|
1165
|
+
* function b( clbk ) {
|
|
1166
|
+
* setTimeout( onTimeout, 0 );
|
|
1167
|
+
* function onTimeout() {
|
|
1168
|
+
* clbk( null, 4 );
|
|
1169
|
+
* }
|
|
1170
|
+
* }
|
|
1171
|
+
*
|
|
1172
|
+
* function done( error, out ) {
|
|
1173
|
+
* if ( error ) {
|
|
1174
|
+
* throw error;
|
|
1175
|
+
* }
|
|
1176
|
+
* console.log( out );
|
|
1177
|
+
* // => [ 2, 4 ]
|
|
1178
|
+
* }
|
|
1179
|
+
*
|
|
1180
|
+
* var fcns = [ a, b ];
|
|
1181
|
+
* var run = ns.parallel.factory( fcns );
|
|
1182
|
+
*
|
|
1183
|
+
* // ...
|
|
1184
|
+
*
|
|
1185
|
+
* run( done );
|
|
1186
|
+
*/
|
|
1187
|
+
parallel: typeof parallel;
|
|
1188
|
+
|
|
1115
1189
|
/**
|
|
1116
1190
|
* Applies a function against an accumulator and each element in a collection and return the accumulated result.
|
|
1117
1191
|
*
|
package/lib/index.js
CHANGED
|
@@ -234,6 +234,15 @@ setReadOnly( ns, 'noneByAsync', require( '@stdlib/utils-async-none-by' ) );
|
|
|
234
234
|
*/
|
|
235
235
|
setReadOnly( ns, 'noneByRightAsync', require( '@stdlib/utils-async-none-by-right' ) );
|
|
236
236
|
|
|
237
|
+
/**
|
|
238
|
+
* @name parallel
|
|
239
|
+
* @memberof ns
|
|
240
|
+
* @readonly
|
|
241
|
+
* @type {Function}
|
|
242
|
+
* @see {@link module:@stdlib/utils/async/parallel}
|
|
243
|
+
*/
|
|
244
|
+
setReadOnly( ns, 'parallel', require( '@stdlib/utils-async-parallel' ) );
|
|
245
|
+
|
|
237
246
|
/**
|
|
238
247
|
* @name reduceAsync
|
|
239
248
|
* @memberof ns
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/utils-async",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Standard async utilities.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"@stdlib/utils-async-map-values": "^0.2.2",
|
|
53
53
|
"@stdlib/utils-async-none-by": "^0.2.2",
|
|
54
54
|
"@stdlib/utils-async-none-by-right": "^0.2.2",
|
|
55
|
+
"@stdlib/utils-async-parallel": "^0.1.0",
|
|
55
56
|
"@stdlib/utils-async-reduce": "^0.2.2",
|
|
56
57
|
"@stdlib/utils-async-reduce-right": "^0.2.2",
|
|
57
58
|
"@stdlib/utils-async-series-waterfall": "^0.2.2",
|