Skip to content

Commit ca2fbd0

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

File tree

4 files changed

+31
-18
lines changed

4 files changed

+31
-18
lines changed

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
{{alias}}( x, predicate[, thisArg] )
23
Cumulatively tests whether at least one array element in a provided array
34
passes a test implemented by a predicate function, while iterating from
@@ -27,9 +28,9 @@
2728

2829
Examples
2930
--------
30-
> function isPositive( v ) { return ( v > 0 ); };
31+
> function predicate( v ) { return ( v > 0 ); };
3132
> var x = [ 1, 1, 0, 0, 0 ];
32-
> var y = {{alias}}( x, isPositive )
33+
> var y = {{alias}}( x, predicate )
3334
[ false, false, false, true, true ]
3435

3536

@@ -71,10 +72,10 @@
7172

7273
Examples
7374
--------
74-
> function isPositive( v ) { return ( v > 0 ); };
7575
> var x = [ 1, 1, 0, 0 ];
7676
> var out = [ false, null, false, null, false, null, false, null ];
77-
> var arr = {{alias}}.assign( x, out, 2, 0, isPositive )
77+
> function predicate( v ) { return ( v > 0 ); };
78+
> var arr = {{alias}}.assign( x, out, 2, 0, predicate )
7879
[ false, null, ..., true, null ]
7980
> var bool = ( arr === out )
8081
true

lib/node_modules/@stdlib/array/base/cuany-by-right/docs/types/index.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ interface CuanyByRight {
100100
*
101101
* @example
102102
* function isPositive( v ) {
103-
* return v > 0;
103+
* return v > 0;
104104
* }
105105
* var x = [ 1, 1, 0, 0, 0 ];
106106
* var y = [ false, null, false, null, false, null, false, null, false, null ];
@@ -172,7 +172,7 @@ interface CuanyByRight {
172172
*
173173
* @example
174174
* function isPositive( v ) {
175-
* return v > 0;
175+
* return v > 0;
176176
* }
177177
* var x = [ 1, 1, 0, 0, 0 ];
178178
*
@@ -181,7 +181,7 @@ interface CuanyByRight {
181181
*
182182
* @example
183183
* function isPositive( v ) {
184-
* return v > 0;
184+
* return v > 0;
185185
* }
186186
* var x = [ 0, 1, 1, 0, 0 ];
187187
* var y = [ false, null, false, null, false, null, false, null, false, null ];

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

+20-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* limitations under the License.
1717
*/
1818

19-
2019
import cuanyByRight = require( './index' );
2120

2221
/**
@@ -57,7 +56,24 @@ function isPositive( value: number ): boolean {
5756
cuanyByRight( new Uint8ClampedArray( [ 1, 2, 3 ] ), isPositive, {} ); // $ExpectType boolean[]
5857
}
5958

60-
// 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+
cuanyByRight( 1, isPositive ); // $ExpectError
62+
cuanyByRight( true, isPositive ); // $ExpectError
63+
cuanyByRight( false, isPositive ); // $ExpectError
64+
cuanyByRight( null, isPositive ); // $ExpectError
65+
cuanyByRight( void 0, isPositive ); // $ExpectError
66+
cuanyByRight( {}, isPositive ); // $ExpectError
67+
68+
cuanyByRight( 1, isPositive, {} ); // $ExpectError
69+
cuanyByRight( true, isPositive, {} ); // $ExpectError
70+
cuanyByRight( false, isPositive, {} ); // $ExpectError
71+
cuanyByRight( null, isPositive, {} ); // $ExpectError
72+
cuanyByRight( void 0, isPositive, {} ); // $ExpectError
73+
cuanyByRight( {}, isPositive, {} ); // $ExpectError
74+
}
75+
76+
// The compiler throws an error if the function is provided a second argument which is not function...
6177
{
6278
const x = [ 1, 2, 3, 4 ];
6379

@@ -87,7 +103,7 @@ function isPositive( value: number ): boolean {
87103
const y = [ false, null, false, null, false, null, false, null, false, null ];
88104

89105
cuanyByRight.assign( x, y, 2, 0, isPositive ); // $ExpectType (boolean | null)[]
90-
cuanyByRight.assign( x, y, 2, 0, isPositive, {} ); // $ExpectType (boolean | null)[]
106+
cuanyByRight.assign( x, y, 2, 0, isPositive, {} ); // $ExpectType (boolean | null)[]
91107
cuanyByRight.assign( x, new Float64Array( 4 ), 1, 0, isPositive ); // $ExpectType Float64Array
92108
cuanyByRight.assign( x, new Float32Array( 4 ), 1, 0, isPositive ); // $ExpectType Float32Array
93109
cuanyByRight.assign( x, new Int32Array( 4 ), 1, 0, isPositive ); // $ExpectType Int32Array
@@ -148,7 +164,6 @@ function isPositive( value: number ): boolean {
148164
cuanyByRight.assign( x, {}, 2, 0, isPositive, {} ); // $ExpectError
149165
}
150166

151-
152167
// The compiler throws an error if the `assign` method is provided a third argument which is not a number...
153168
{
154169
const x = [ false, false, true, false, false ];
@@ -193,7 +208,7 @@ function isPositive( value: number ): boolean {
193208
cuanyByRight.assign( x, y, 1, [], isPositive, {} ); // $ExpectError
194209
}
195210

196-
// 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...
197212
{
198213
const x = [ false, false, true, false, false ];
199214
const y = [ false, null, false, null, false, null, false, null, false, null ];

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

+3-6
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,11 @@
4444
*
4545
* var x = [ 0, 1, 0, 0, 0 ];
4646
*
47-
* var y1 = cuanyByRight( x, isPositive );
48-
* // returns [ false, false, false, true, true ]
49-
*
50-
* var y2 = [ false, null, false, null, false, null, false, null, false, null ];
51-
* var out = cuanyByRight.assign( x, y2, 2, 0, isPositive );
47+
* var y = [ false, null, false, null, false, null, false, null, false, null ];
48+
* var out = cuanyByRight.assign( x, y, 2, 0, isPositive );
5249
* // returns [ false, null, false, null, false, null, true, null, true, null ]
5350
*
54-
* var bool = ( out === y2 );
51+
* var bool = ( out === y );
5552
* // returns true
5653
*/
5754

0 commit comments

Comments
 (0)