Skip to content

Commit 16f2cb7

Browse files
committed
Add find(), every(), some()
1 parent fdab546 commit 16f2cb7

File tree

7 files changed

+598
-142
lines changed

7 files changed

+598
-142
lines changed

README.md

Lines changed: 87 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ Do `fetch()` networking in loops, resolve Promises, anything async goes. Perform
88

99
<img src="https://i.imgur.com/GcykVyN.png" width="404" alt="Asyncro Example">
1010

11-
---
11+
* * *
1212

1313
## What's in the Box
1414

1515
<img src="https://i.imgur.com/yiiq6Gx.png" width="275" alt="Asyncro Example 2">
1616

17-
18-
---
17+
* * *
1918

2019
## Installation
2120

@@ -40,7 +39,7 @@ async function example() {
4039

4140
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
4241

43-
#### reduce
42+
### reduce
4443

4544
Invoke an async reducer function on each item in the given Array,
4645
where the reducer transforms an accumulator value based on each item iterated over.
@@ -50,9 +49,9 @@ where the reducer transforms an accumulator value based on each item iterated ov
5049
5150
**Parameters**
5251

53-
- `array` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** The Array to reduce
54-
- `reducer` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Async function, gets passed `(accumulator, value, index, array)` and returns a new value for `accumulator`
55-
- `accumulator` **\[Any]** Optional initial accumulator value
52+
- `array` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** The Array to reduce
53+
- `reducer` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Async function, gets passed `(accumulator, value, index, array)` and returns a new value for `accumulator`
54+
- `accumulator` **any?** Optional initial accumulator value
5655

5756
**Examples**
5857

@@ -69,7 +68,7 @@ await reduce(
6968

7069
Returns **any** final `accumulator` value
7170

72-
#### map
71+
### map
7372

7473
Invoke an async transform function on each item in the given Array **in parallel**,
7574
returning the resulting Array of mapped/transformed items.
@@ -78,8 +77,8 @@ returning the resulting Array of mapped/transformed items.
7877
7978
**Parameters**
8079

81-
- `array` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** The Array to map over
82-
- `mapper` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Async function, gets passed `(value, index, array)`, returns the new value.
80+
- `array` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** The Array to map over
81+
- `mapper` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Async function, gets passed `(value, index, array)`, returns the new value.
8382

8483
**Examples**
8584

@@ -90,9 +89,9 @@ await map(
9089
)
9190
```
9291

93-
Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** resulting mapped/transformed values.
92+
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** resulting mapped/transformed values.
9493

95-
#### filter
94+
### filter
9695

9796
Invoke an async filter function on each item in the given Array **in parallel**,
9897
returning an Array of values for which the filter function returned a truthy value.
@@ -101,8 +100,8 @@ returning an Array of values for which the filter function returned a truthy val
101100
102101
**Parameters**
103102

104-
- `array` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** The Array to filter
105-
- `filterer` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Async function. Gets passed `(value, index, array)`, returns true to keep the value in the resulting filtered Array.
103+
- `array` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** The Array to filter
104+
- `filterer` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Async function. Gets passed `(value, index, array)`, returns true to keep the value in the resulting filtered Array.
106105

107106
**Examples**
108107

@@ -113,15 +112,82 @@ await filter(
113112
)
114113
```
115114

116-
Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** resulting filtered values
115+
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** resulting filtered values
116+
117+
### find
118+
119+
Invoke an async function on each item in the given Array **in parallel**,
120+
returning the first element predicate returns truthy for.
121+
122+
> This is an asynchronous, parallelized version of `Array.prototype.find()`.
123+
124+
**Parameters**
125+
126+
- `array` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** The Array to find
127+
- `predicate` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Async function. Gets passed `(value, index, array)`, returns true to be the find result.
128+
129+
**Examples**
130+
131+
```javascript
132+
await find(
133+
['foo', 'baz', 'root'],
134+
async v => (await fetch(v)).name === 'baz'
135+
)
136+
```
137+
138+
Returns **any** resulting find value
139+
140+
### every
141+
142+
Checks if predicate returns truthy for **all** elements of collection **in parallel**.
143+
144+
> This is an asynchronous, parallelized version of `Array.prototype.every()`.
145+
146+
**Parameters**
147+
148+
- `array` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** The Array to iterate over.
149+
- `predicate` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Async function. Gets passed `(value, index, array)`, The function invoked per iteration.
150+
151+
**Examples**
152+
153+
```javascript
154+
await every(
155+
[2, 3],
156+
async v => (await fetch(v)).ok
157+
)
158+
```
159+
160+
Returns **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns true if **all** element passes the predicate check, else false.
161+
162+
### some
163+
164+
Checks if predicate returns truthy for **any** element of collection **in parallel**.
165+
166+
> This is an asynchronous, parallelized version of `Array.prototype.some()`.
167+
168+
**Parameters**
169+
170+
- `array` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** The Array to iterate over.
171+
- `filterer` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Async function. Gets passed `(value, index, array)`, The function invoked per iteration.
172+
173+
**Examples**
174+
175+
```javascript
176+
await some(
177+
['foo', 'baz'],
178+
async v => (await fetch(v)).ok
179+
)
180+
```
181+
182+
Returns **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns true if **any** element passes the predicate check, else false.
117183

118-
#### parallel
184+
### parallel
119185

120186
Invoke all async functions in an Array or Object **in parallel**, returning the result.
121187

122188
**Parameters**
123189

124-
- `list` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)> | [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)&lt;[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)>)** Array/Object with values that are async functions to invoke.
190+
- `list` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)> | [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)&lt;[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)>)** Array/Object with values that are async functions to invoke.
125191

126192
**Examples**
127193

@@ -132,15 +198,15 @@ await parallel([
132198
])
133199
```
134200

135-
Returns **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))** same structure as `list` input, but with values now resolved.
201+
Returns **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))** same structure as `list` input, but with values now resolved.
136202

137-
#### series
203+
### series
138204

139205
Invoke all async functions in an Array or Object **sequentially**, returning the result.
140206

141207
**Parameters**
142208

143-
- `list` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)> | [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)&lt;[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)>)** Array/Object with values that are async functions to invoke.
209+
- `list` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)> | [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)&lt;[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)>)** Array/Object with values that are async functions to invoke.
144210

145211
**Examples**
146212

@@ -151,4 +217,4 @@ await series([
151217
])
152218
```
153219

154-
Returns **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))** same structure as `list` input, but with values now resolved.
220+
Returns **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) \| [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))** same structure as `list` input, but with values now resolved.

docs/assets/anchor.js

Lines changed: 21 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1+
'use strict';
2+
13
/*!
24
* AnchorJS - v1.2.1 - 2015-07-02
35
* https://github.com/bryanbraun/anchorjs
46
* Copyright (c) 2015 Bryan Braun; Licensed MIT
57
*/
68

79
function AnchorJS(options) {
8-
'use strict';
9-
1010
this.options = options || {};
1111

12-
this._applyRemainingDefaultOptions = function(opts) {
12+
this._applyRemainingDefaultOptions = function (opts) {
1313
this.options.icon = this.options.hasOwnProperty('icon') ? opts.icon : '\ue9cb'; // Accepts characters (and also URLs?), like '#', '¶', '❡', or '§'.
1414
this.options.visible = this.options.hasOwnProperty('visible') ? opts.visible : 'hover'; // Also accepts 'always'
1515
this.options.placement = this.options.hasOwnProperty('placement') ? opts.placement : 'right'; // Also accepts 'left'
@@ -18,19 +18,8 @@ function AnchorJS(options) {
1818

1919
this._applyRemainingDefaultOptions(options);
2020

21-
this.add = function(selector) {
22-
var elements,
23-
elsWithIds,
24-
idList,
25-
elementID,
26-
i,
27-
roughText,
28-
tidyText,
29-
index,
30-
count,
31-
newTidyText,
32-
readableID,
33-
anchor;
21+
this.add = function (selector) {
22+
var elements, elsWithIds, idList, elementID, i, roughText, tidyText, index, count, newTidyText, readableID, anchor;
3423

3524
this._applyRemainingDefaultOptions(this.options);
3625

@@ -55,7 +44,6 @@ function AnchorJS(options) {
5544
});
5645

5746
for (i = 0; i < elements.length; i++) {
58-
5947
if (elements[i].hasAttribute('id')) {
6048
elementID = elements[i].getAttribute('id');
6149
} else {
@@ -65,12 +53,12 @@ function AnchorJS(options) {
6553
// spaces with hyphens, truncate to 32 characters, and make toLowerCase.
6654
//
6755
// Example string: // '⚡⚡⚡ Unicode icons are cool--but they definitely don't belong in a URL fragment.'
68-
tidyText = roughText.replace(/[^\w\s-]/gi, '') // ' Unicode icons are cool--but they definitely dont belong in a URL fragment'
69-
.replace(/\s+/g, '-') // '-Unicode-icons-are-cool--but-they-definitely-dont-belong-in-a-URL-fragment'
70-
.replace(/-{2,}/g, '-') // '-Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL-fragment'
71-
.substring(0, 64) // '-Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL'
72-
.replace(/^-+|-+$/gm, '') // 'Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL'
73-
.toLowerCase(); // 'unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-url'
56+
tidyText = roughText.replace(/[^\w\s-]/gi, '') // ' Unicode icons are cool--but they definitely dont belong in a URL fragment'
57+
.replace(/\s+/g, '-') // '-Unicode-icons-are-cool--but-they-definitely-dont-belong-in-a-URL-fragment'
58+
.replace(/-{2,}/g, '-') // '-Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL-fragment'
59+
.substring(0, 64) // '-Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL'
60+
.replace(/^-+|-+$/gm, '') // 'Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL'
61+
.toLowerCase(); // 'unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-url'
7462

7563
// Compare our generated ID to existing IDs (and increment it if needed)
7664
// before we add it to the page.
@@ -121,7 +109,8 @@ function AnchorJS(options) {
121109
anchor.style.marginLeft = '-1em';
122110
anchor.style.paddingRight = '0.5em';
123111
elements[i].insertBefore(anchor, elements[i].firstChild);
124-
} else { // if the option provided is `right` (or anything else).
112+
} else {
113+
// if the option provided is `right` (or anything else).
125114
anchor.style.paddingLeft = '0.375em';
126115
elements[i].appendChild(anchor);
127116
}
@@ -130,7 +119,7 @@ function AnchorJS(options) {
130119
return this;
131120
};
132121

133-
this.remove = function(selector) {
122+
this.remove = function (selector) {
134123
var domAnchor,
135124
elements = document.querySelectorAll(selector);
136125
for (var i = 0; i < elements.length; i++) {
@@ -142,36 +131,18 @@ function AnchorJS(options) {
142131
return this;
143132
};
144133

145-
this._addBaselineStyles = function() {
134+
this._addBaselineStyles = function () {
146135
// We don't want to add global baseline styles if they've been added before.
147136
if (document.head.querySelector('style.anchorjs') !== null) {
148137
return;
149138
}
150139

151140
var style = document.createElement('style'),
152-
linkRule =
153-
' .anchorjs-link {' +
154-
' opacity: 0;' +
155-
' text-decoration: none;' +
156-
' -webkit-font-smoothing: antialiased;' +
157-
' -moz-osx-font-smoothing: grayscale;' +
158-
' }',
159-
hoverRule =
160-
' *:hover > .anchorjs-link,' +
161-
' .anchorjs-link:focus {' +
162-
' opacity: 1;' +
163-
' }',
164-
anchorjsLinkFontFace =
165-
' @font-face {' +
166-
' font-family: "anchorjs-icons";' +
167-
' font-style: normal;' +
168-
' font-weight: normal;' + // Icon from icomoon; 10px wide & 10px tall; 2 empty below & 4 above
169-
' src: url(data:application/x-font-ttf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mgABAAAABQBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEADgAAAAEAAAAAAAIABwCfAAEAAAAAAAMADgBLAAEAAAAAAAQADgC0AAEAAAAAAAUACwAqAAEAAAAAAAYADgB1AAEAAAAAAAoAGgDeAAMAAQQJAAEAHAAOAAMAAQQJAAIADgCmAAMAAQQJAAMAHABZAAMAAQQJAAQAHADCAAMAAQQJAAUAFgA1AAMAAQQJAAYAHACDAAMAAQQJAAoANAD4YW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzUmVndWxhcgBSAGUAZwB1AGwAYQByYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format("truetype");' +
170-
' }',
171-
pseudoElContent =
172-
' [data-anchorjs-icon]::after {' +
173-
' content: attr(data-anchorjs-icon);' +
174-
' }',
141+
linkRule = ' .anchorjs-link {' + ' opacity: 0;' + ' text-decoration: none;' + ' -webkit-font-smoothing: antialiased;' + ' -moz-osx-font-smoothing: grayscale;' + ' }',
142+
hoverRule = ' *:hover > .anchorjs-link,' + ' .anchorjs-link:focus {' + ' opacity: 1;' + ' }',
143+
anchorjsLinkFontFace = ' @font-face {' + ' font-family: "anchorjs-icons";' + ' font-style: normal;' + ' font-weight: normal;' + // Icon from icomoon; 10px wide & 10px tall; 2 empty below & 4 above
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AoAAMQAAAAAACgAUAB4AmgABAAAABQBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEADgAAAAEAAAAAAAIABwCfAAEAAAAAAAMADgBLAAEAAAAAAAQADgC0AAEAAAAAAAUACwAqAAEAAAAAAAYADgB1AAEAAAAAAAoAGgDeAAMAAQQJAAEAHAAOAAMAAQQJAAIADgCmAAMAAQQJAAMAHABZAAMAAQQJAAQAHADCAAMAAQQJAAUAFgA1AAMAAQQJAAYAHACDAAMAAQQJAAoANAD4YW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzUmVndWxhcgBSAGUAZwB1AGwAYQByYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format("truetype");' + ' }',
145+
pseudoElContent = ' [data-anchorjs-icon]::after {' + ' content: attr(data-anchorjs-icon);' + ' }',
175146
firstStyleEl;
176147

177148
style.className = 'anchorjs';
@@ -194,4 +165,4 @@ function AnchorJS(options) {
194165
};
195166
}
196167

197-
var anchors = new AnchorJS();
168+
var anchors = new AnchorJS();

0 commit comments

Comments
 (0)