@stdlib/iter-some-by 0.0.3 → 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 CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2021 The Stdlib Authors.
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
 
@@ -180,6 +198,10 @@ This package is part of [stdlib][stdlib], a standard library for JavaScript and
180
198
 
181
199
  For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib].
182
200
 
201
+ #### Community
202
+
203
+ [![Chat][chat-image]][chat-url]
204
+
183
205
  ---
184
206
 
185
207
  ## License
@@ -189,7 +211,7 @@ See [LICENSE][stdlib-license].
189
211
 
190
212
  ## Copyright
191
213
 
192
- Copyright &copy; 2016-2021. The Stdlib [Authors][stdlib-authors].
214
+ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
193
215
 
194
216
  </section>
195
217
 
@@ -208,9 +230,23 @@ Copyright &copy; 2016-2021. The Stdlib [Authors][stdlib-authors].
208
230
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/iter-some-by/main.svg
209
231
  [coverage-url]: https://codecov.io/github/stdlib-js/iter-some-by?branch=main
210
232
 
211
- [dependencies-image]: https://img.shields.io/david/stdlib-js/iter-some-by
233
+ <!--
234
+
235
+ [dependencies-image]: https://img.shields.io/david/stdlib-js/iter-some-by.svg
212
236
  [dependencies-url]: https://david-dm.org/stdlib-js/iter-some-by/main
213
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
+
247
+ [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
248
+ [chat-url]: https://gitter.im/stdlib-js/stdlib/
249
+
214
250
  [stdlib]: https://github.com/stdlib-js/stdlib
215
251
 
216
252
  [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
@@ -219,6 +255,20 @@ Copyright &copy; 2016-2021. The Stdlib [Authors][stdlib-authors].
219
255
 
220
256
  [mdn-iterator-protocol]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterator_protocol
221
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
+
222
272
  </section>
223
273
 
224
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
- if ( hasOwnProp( v, 'value' ) && predicate.call( thisArg, v.value, i ) ) {
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",
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": {
@@ -28,7 +28,7 @@
28
28
  "examples": "make examples",
29
29
  "benchmark": "make benchmark"
30
30
  },
31
- "homepage": "https://github.com/stdlib-js/stdlib",
31
+ "homepage": "https://stdlib.io",
32
32
  "repository": {
33
33
  "type": "git",
34
34
  "url": "git://github.com/stdlib-js/iter-some-by.git"
@@ -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",
package/CHANGELOG.md DELETED
@@ -1,5 +0,0 @@
1
- # CHANGELOG
2
-
3
- > Package changelog.
4
-
5
- See [GitHub Releases](https://github.com/stdlib-js/iter-some-by/releases) for the changelog.