Skip to content

Commit 89e005a

Browse files
committed
chore: minor clean-up
1 parent 99cca3d commit 89e005a

File tree

17 files changed

+148
-110
lines changed

17 files changed

+148
-110
lines changed

lib/node_modules/@stdlib/array/base/cuany-by/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ function isPositive( value ) {
127127
var x = bernoulli( 10, 0.1 );
128128
console.log( x );
129129

130+
// Cumulatively determine whether at least one element is positive:
130131
var out = cuanyBy( x, isPositive );
131132
console.log( out );
132133
```

lib/node_modules/@stdlib/array/base/cuany-by/benchmark/benchmark.length.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var isArray = require( '@stdlib/assert/is-array' );
2626
var filled = require( '@stdlib/array/base/filled' );
2727
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
2828
var pkg = require( '@stdlib/array/base/cuany-by/package.json' ).name;
29-
var cuanyBy = require( '@stdlib/array/base/cuany-by/lib' );
29+
var cuanyBy = require( './../lib' );
3030

3131

3232
// FUNCTIONS //
@@ -39,7 +39,7 @@ var cuanyBy = require( '@stdlib/array/base/cuany-by/lib' );
3939
* @returns {Function} benchmark function
4040
*/
4141
function createBenchmark( len ) {
42-
var x = filled( 1.5, len );
42+
var x = filled( 0, len );
4343
return benchmark;
4444

4545
/**

lib/node_modules/@stdlib/array/base/cuany-by/docs/repl.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
predicate: Function
5656
Predicate function.
5757

58+
thisArg: any (optional)
59+
Execution context.
60+
5861
Returns
5962
-------
6063
y: ArrayLikeObject

lib/node_modules/@stdlib/array/base/cuany-by/docs/types/test.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,24 @@ function isPositive( value: number ): boolean {
5656
cuanyBy( new Uint8ClampedArray( [ 1, 2, 3 ] ), isPositive, {} ); // $ExpectType boolean[]
5757
}
5858

59-
// The compiler throws an error if the function is provided a first argument which is not like a function..
59+
// The compiler throws an error if the function is provided a first argument which is not an array-like object...
60+
{
61+
cuanyBy( 1, isPositive ); // $ExpectError
62+
cuanyBy( true, isPositive ); // $ExpectError
63+
cuanyBy( false, isPositive ); // $ExpectError
64+
cuanyBy( null, isPositive ); // $ExpectError
65+
cuanyBy( void 0, isPositive ); // $ExpectError
66+
cuanyBy( {}, isPositive ); // $ExpectError
67+
68+
cuanyBy( 1, isPositive, {} ); // $ExpectError
69+
cuanyBy( true, isPositive, {} ); // $ExpectError
70+
cuanyBy( false, isPositive, {} ); // $ExpectError
71+
cuanyBy( null, isPositive, {} ); // $ExpectError
72+
cuanyBy( void 0, isPositive, {} ); // $ExpectError
73+
cuanyBy( {}, isPositive, {} ); // $ExpectError
74+
}
75+
76+
// The compiler throws an error if the function is provided a second argument which is not function...
6077
{
6178
const x = [ 1, 2, 3, 4 ];
6279

@@ -147,7 +164,6 @@ function isPositive( value: number ): boolean {
147164
cuanyBy.assign( x, {}, 2, 0, isPositive, {} ); // $ExpectError
148165
}
149166

150-
151167
// The compiler throws an error if the `assign` method is provided a third argument which is not a number...
152168
{
153169
const x = [ false, false, true, false, false ];
@@ -192,7 +208,7 @@ function isPositive( value: number ): boolean {
192208
cuanyBy.assign( x, y, 1, [], isPositive, {} ); // $ExpectError
193209
}
194210

195-
// The compiler throws an error if the `assign` method is provided a fourth argument which is not like a function...
211+
// The compiler throws an error if the `assign` method is provided a fifth argument which is not like a function...
196212
{
197213
const x = [ false, false, true, false, false ];
198214
const y = [ false, null, false, null, false, null, false, null, false, null ];

lib/node_modules/@stdlib/array/base/cuany-by/examples/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@
1919
'use strict';
2020

2121
var bernoulli = require( '@stdlib/random/array/bernoulli' );
22-
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' );
2322
var cuanyBy = require( './../lib' );
2423

24+
function isPositive( value ) {
25+
return ( value > 0 );
26+
}
27+
2528
// Create an array of random values:
2629
var x = bernoulli( 10, 0.1 );
2730
console.log( x );
2831

29-
// Cumulatively determine whether values are truthy:
30-
var out = cuanyBy( x, isPositiveInteger );
32+
// Cumulatively determine whether at least one element is positive:
33+
var out = cuanyBy( x, isPositive );
3134
console.log( out );

lib/node_modules/@stdlib/array/base/cuany-by/lib/assign.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ function indexed( x, y, stride, offset, predicate, thisArg ) {
7878
* @returns {Collection} output array
7979
*
8080
* @example
81+
* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );
82+
* var arraylike2object = require( '@stdlib/array/base/arraylike2object' );
83+
*
8184
* function isPositive( v ) {
8285
* return v > 0;
8386
* }
8487
*
85-
* var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );
86-
* var arraylike2object = require( '@stdlib/array/base/arraylike2object' );
87-
*
8888
* var x = toAccessorArray( [ false, false, false, true, false ] );
8989
* var y = toAccessorArray( [ false, null, false, null, false, null, false, null, false, null ] );
9090
*
@@ -136,7 +136,7 @@ function accessors( x, y, stride, offset, predicate, thisArg ) {
136136
// MAIN //
137137

138138
/**
139-
* Cumulatively tests whether at least one element in a provided array passes a test implemented by a predicate function and assigns results to provided output array.
139+
* Cumulatively tests whether at least one element in a provided array passes a test implemented by a predicate function and assigns results to a provided output array.
140140
*
141141
* @param {Collection} x - input array
142142
* @param {Collection} y - output array

0 commit comments

Comments
 (0)