8000 Auto-generated commit · stdlib-js/utils-async-none-by@1911613 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1911613

Browse files
committed
Auto-generated commit
1 parent 609ac18 commit 1911613

File tree

9 files changed

+120
-66
lines changed

9 files changed

+120
-66
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,8 @@ indent_size = 2
179179
[*.gypi]
180180
indent_style = space
181181
indent_size = 2
182+
183+
# Set properties for citation files:
184+
[*.{cff,cff.txt}]
185+
indent_style = space
186+
indent_size = 2

.github/workflows/productionize.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,6 @@ jobs:
8282
id: transform-error-messages
8383
uses: stdlib-js/transform-errors-action@main
8484

85-
# Format error messages:
86-
- name: 'Replace double quotes with single quotes in rewritten format string error messages'
87-
run: |
88-
find . -name "*.js" -exec sed -E -i "s/Error\( format\( \"([a-zA-Z0-9]+)\"/Error\( format\( '\1'/g" {} \;
89-
90-
# Format string literal error messages:
91-
- name: 'Replace double quotes with single quotes in rewritten string literal error messages'
92-
run: |
93-
find . -name "*.js" -exec sed -E -i "s/Error\( format\(\"([a-zA-Z0-9]+)\"\)/Error\( format\( '\1' \)/g" {} \;
94-
95-
# Format code:
96-
- name: 'Replace double quotes with single quotes in inserted `require` calls'
97-
run: |
98-
find . -name "*.js" -exec sed -E -i "s/require\( ?\"@stdlib\/error-tools-fmtprodmsg\" ?\);/require\( '@stdlib\/error-tools-fmtprodmsg' \);/g" {} \;
99-
10085
# Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency:
10186
- name: 'Update dependencies in package.json'
10287
run: |

CITATION.cff

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

README.md

Lines changed: 49 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ limitations under the License.
1818
1919
-->
2020

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+
2132
# noneByAsync
2233

2334
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
@@ -69,6 +80,12 @@ function predicate( value, next ) {
6980
setTimeout( onTimeout, value );
7081
function onTimeout() {
7182
console.log( value );
83+
/* =>
84+
1000
85+
2500
86+
3000
87+
*/
88+
7289
next( null, false );
7390
}
7491
}
@@ -78,17 +95,12 @@ function done( error, bool ) {
7895
throw error;
7996
}
8097
console.log( bool );
98+
// => true
8199
}
82100

83101
var arr = [ 3000, 2500, 1000 ];
84102

85103
noneByAsync( arr, predicate, done );
86-
/* =>
87-
1000
88-
2500
89-
3000
90-
true
91-
*/
92104
```
93105

94106
If a `predicate` function calls the `next` callback with a truthy test argument, the function stops processing any additional `collection` elements and returns `false` for the test result.
@@ -109,19 +121,19 @@ function done( error, bool ) {
109121
throw error;
110122
}
111123
console.log( bool );
124+
// => false
112125
}
113126

114127
var arr = [ 3000, 2500, 1000 ];
115128

116129
noneByAsync( arr, predicate, done );
117-
// => false
118130
```
119131

120132
The function accepts the following `options`:
121133

122134
- `limit`: the maximum number of pending invocations at any one time. Default: `infinity`.
123135
- `series`: `boolean` indicating whether to sequentially invoke the `predicate` function for each `collection` element. If `true`, the function sets `options.limit=1`. Default: `false`.
124-
- `thisArg`: the execution context for `fcn`.
136+
- `thisArg`: the execution context for `predicate`.
125137

126138
By default, all elements are processed concurrently, which means that the function does **not** guarantee completion order. To process each `collection` element sequentially, set the `series` option to `true`.
127139

@@ -130,6 +142,12 @@ function predicate( value, next ) {
130142
setTimeout( onTimeout, value );
131143
function onTimeout() {
132144
console.log( value );
145+
/* =>
146+
3000
147+
2500
148+
1000
149+
*/
150+
133151
next( null, false );
134152
}
135153
}
@@ -139,6 +157,7 @@ function done( error, bool ) {
139157
throw error;
140158
}
141159
console.log( bool );
160+
// => true
142161
}
143162

144163
var arr = [ 3000, 2500, 1000 ];
@@ -148,12 +167,6 @@ var opts = {
148167
};
149168

150169
noneByAsync( arr, opts, predicate, done );
151-
/* =>
152-
3000
153-
2500
154-
1000
155-
true
156-
*/
157170
```
158171

159172
To limit the maximum number of pending function invocations, set the `limit` option.
@@ -163,6 +176,12 @@ function predicate( value, next ) {
163176
setTimeout( onTimeout, value );
164177
function onTimeout() {
165178
console.log( value );
179+
/* =>
180+
2500
181+
3000
182+
1000
183+
*/
184+
166185
next( null, false );
167186
}
168187
}
@@ -172,6 +191,7 @@ function done( error, bool ) {
172191
throw error;
173192
}
174193
console.log( bool );
194+
// => true
175195
}
176196

177197
var arr = [ 3000, 2500, 1000 ];
@@ -181,12 +201,6 @@ var opts = {
181201
};
182202

183203
noneByAsync( arr, opts, predicate, done );
184-
/* =>
185-
2500
186-
3000
187-
1000
188-
true
189-
*/
190204
```
191205

192206
To set the execution context of the `predicate` function, set the `thisArg` option.
@@ -236,9 +250,21 @@ The actual number of provided arguments depends on function `length`. If the `pr
236250
```javascript
237251
function predicate( value, i, collection, next ) {
238252
console.log( 'collection: %s. %d: %d', collection.join( ',' ), i, value );
253+
/* =>
254+
collection: 3000,2500,1000. 0: 3000
255+
collection: 3000,2500,1000. 1: 2500
256+
collection: 3000,2500,1000. 2: 1000
257+
*/
258+
239259
setTimeout( onTimeout, value );
240260
function onTimeout() {
241261
console.log( value );
262+
/* =>
263+
1000
264+
2500
265+
3000
266+
*/
267+
242268
next( null, false );
243269
}
244270
}
@@ -248,20 +274,12 @@ function done( error, bool ) {
248274
throw error;
249275
}
250276
console.log( bool );
277+
// => true
251278
}
252279

253280
var arr = [ 3000, 2500, 1000 ];
254281

255282
noneByAsync( arr, predicate, done );
256-
/* =>
257-
collection: 3000,2500,1000. 0: 3000
258-
collection: 3000,2500,1000. 1: 2500
259-
collection: 3000,2500,1000. 2: 1000
260-
1000
261-
2500
262-
3000
263-
true
264-
*/
265283
```
266284

267285
#### noneByAsync.factory( \[options,] predicate )
@@ -289,7 +307,7 @@ var f = noneByAsync.factory( predicate );
289307
var arr1 = [ 3000, 2500, 1000 ];
290308

291309
f( arr1, done );
292-
/* =>
310+
/* e.g., =>
293311
1000
294312
2500
295313
3000
@@ -299,7 +317,7 @@ f( arr1, done );
299317
var arr2 = [ 300, 250, 100 ];
300318

301319
f( arr2, done );
302-
/* =>
320+
/* e.g., =>
303321
100
304322
250
305323
300

dist/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/// <reference path="../docs/types/index.d.ts" />
2+
import noneByAsync from '../docs/types/index';
3+
export = noneByAsync;

dist/index.js

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
0