@stdlib/iter-some-by 0.0.6 → 0.0.7
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 +45 -2
- package/lib/main.js +1 -7
- package/package.json +1 -2
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2022 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ limitations under the License.
|
|
|
20
20
|
|
|
21
21
|
# iterSomeBy
|
|
22
22
|
|
|
23
|
-
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] [![dependencies][dependencies-image]][dependencies-url]
|
|
23
|
+
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
|
|
24
24
|
|
|
25
25
|
> Test whether at least `n` [iterated][mdn-iterator-protocol] values pass a test implemented by a predicate function.
|
|
26
26
|
|
|
@@ -167,6 +167,24 @@ console.log( bool );
|
|
|
167
167
|
|
|
168
168
|
<!-- /.references -->
|
|
169
169
|
|
|
170
|
+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
|
|
171
|
+
|
|
172
|
+
<section class="related">
|
|
173
|
+
|
|
174
|
+
* * *
|
|
175
|
+
|
|
176
|
+
## See Also
|
|
177
|
+
|
|
178
|
+
- <span class="package-name">[`@stdlib/iter/any-by`][@stdlib/iter/any-by]</span><span class="delimiter">: </span><span class="description">test whether at least one iterated value passes a test implemented by a predicate function.</span>
|
|
179
|
+
- <span class="package-name">[`@stdlib/iter/every-by`][@stdlib/iter/every-by]</span><span class="delimiter">: </span><span class="description">test whether every iterated value passes a test implemented by a predicate function.</span>
|
|
180
|
+
- <span class="package-name">[`@stdlib/iter/for-each`][@stdlib/iter/for-each]</span><span class="delimiter">: </span><span class="description">create an iterator which invokes a function for each iterated value before returning the iterated value.</span>
|
|
181
|
+
- <span class="package-name">[`@stdlib/iter/none-by`][@stdlib/iter/none-by]</span><span class="delimiter">: </span><span class="description">test whether every iterated value fails a test implemented by a predicate function.</span>
|
|
182
|
+
- <span class="package-name">[`@stdlib/iter/some`][@stdlib/iter/some]</span><span class="delimiter">: </span><span class="description">test whether at least `n` iterated values are truthy.</span>
|
|
183
|
+
|
|
184
|
+
</section>
|
|
185
|
+
|
|
186
|
+
<!-- /.related -->
|
|
187
|
+
|
|
170
188
|
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
171
189
|
|
|
172
190
|
|
|
@@ -193,7 +211,7 @@ See [LICENSE][stdlib-license].
|
|
|
193
211
|
|
|
194
212
|
## Copyright
|
|
195
213
|
|
|
196
|
-
Copyright © 2016-
|
|
214
|
+
Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
|
|
197
215
|
|
|
198
216
|
</section>
|
|
199
217
|
|
|
@@ -212,9 +230,20 @@ Copyright © 2016-2021. The Stdlib [Authors][stdlib-authors].
|
|
|
212
230
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/iter-some-by/main.svg
|
|
213
231
|
[coverage-url]: https://codecov.io/github/stdlib-js/iter-some-by?branch=main
|
|
214
232
|
|
|
233
|
+
<!--
|
|
234
|
+
|
|
215
235
|
[dependencies-image]: https://img.shields.io/david/stdlib-js/iter-some-by.svg
|
|
216
236
|
[dependencies-url]: https://david-dm.org/stdlib-js/iter-some-by/main
|
|
217
237
|
|
|
238
|
+
-->
|
|
239
|
+
|
|
240
|
+
[umd]: https://github.com/umdjs/umd
|
|
241
|
+
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
242
|
+
|
|
243
|
+
[deno-url]: https://github.com/stdlib-js/iter-some-by/tree/deno
|
|
244
|
+
[umd-url]: https://github.com/stdlib-js/iter-some-by/tree/umd
|
|
245
|
+
[esm-url]: https://github.com/stdlib-js/iter-some-by/tree/esm
|
|
246
|
+
|
|
218
247
|
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
|
|
219
248
|
[chat-url]: https://gitter.im/stdlib-js/stdlib/
|
|
220
249
|
|
|
@@ -226,6 +255,20 @@ Copyright © 2016-2021. The Stdlib [Authors][stdlib-authors].
|
|
|
226
255
|
|
|
227
256
|
[mdn-iterator-protocol]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterator_protocol
|
|
228
257
|
|
|
258
|
+
<!-- <related-links> -->
|
|
259
|
+
|
|
260
|
+
[@stdlib/iter/any-by]: https://www.npmjs.com/package/@stdlib/iter-any-by
|
|
261
|
+
|
|
262
|
+
[@stdlib/iter/every-by]: https://www.npmjs.com/package/@stdlib/iter-every-by
|
|
263
|
+
|
|
264
|
+
[@stdlib/iter/for-each]: https://www.npmjs.com/package/@stdlib/iter-for-each
|
|
265
|
+
|
|
266
|
+
[@stdlib/iter/none-by]: https://www.npmjs.com/package/@stdlib/iter-none-by
|
|
267
|
+
|
|
268
|
+
[@stdlib/iter/some]: https://www.npmjs.com/package/@stdlib/iter-some
|
|
269
|
+
|
|
270
|
+
<!-- </related-links> -->
|
|
271
|
+
|
|
229
272
|
</section>
|
|
230
273
|
|
|
231
274
|
<!-- /.links -->
|
package/lib/main.js
CHANGED
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
|
|
23
23
|
var isIteratorLike = require( '@stdlib/assert-is-iterator-like' );
|
|
24
24
|
var isFunction = require( '@stdlib/assert-is-function' );
|
|
25
|
-
var hasOwnProp = require( '@stdlib/assert-has-own-property' );
|
|
26
25
|
var isPositiveInteger = require( '@stdlib/assert-is-positive-integer' ).isPrimitive;
|
|
27
26
|
|
|
28
27
|
|
|
@@ -71,11 +70,7 @@ function iterSomeBy( iterator, n, predicate, thisArg ) {
|
|
|
71
70
|
i += 1;
|
|
72
71
|
v = iterator.next();
|
|
73
72
|
if ( v.done ) {
|
|
74
|
-
|
|
75
|
-
count += 1;
|
|
76
|
-
return ( count === n );
|
|
77
|
-
}
|
|
78
|
-
break;
|
|
73
|
+
return false;
|
|
79
74
|
}
|
|
80
75
|
if ( predicate.call( thisArg, v.value, i ) ) {
|
|
81
76
|
count += 1;
|
|
@@ -84,7 +79,6 @@ function iterSomeBy( iterator, n, predicate, thisArg ) {
|
|
|
84
79
|
}
|
|
85
80
|
}
|
|
86
81
|
}
|
|
87
|
-
return false;
|
|
88
82
|
}
|
|
89
83
|
|
|
90
84
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/iter-some-by",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Test whether at least `n` iterated values pass a test implemented by a predicate function.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@stdlib/assert-has-own-property": "^0.0.x",
|
|
41
40
|
"@stdlib/assert-is-function": "^0.0.x",
|
|
42
41
|
"@stdlib/assert-is-iterator-like": "^0.0.x",
|
|
43
42
|
"@stdlib/assert-is-positive-integer": "^0.0.x",
|