diff --git a/lib/node_modules/@stdlib/array/base/cuany-by-right/docs/repl.txt b/lib/node_modules/@stdlib/array/base/cuany-by-right/docs/repl.txt index d22386ea1fa..9aa9cc72bce 100644 --- a/lib/node_modules/@stdlib/array/base/cuany-by-right/docs/repl.txt +++ b/lib/node_modules/@stdlib/array/base/cuany-by-right/docs/repl.txt @@ -1,3 +1,4 @@ + {{alias}}( x, predicate[, thisArg] ) Cumulatively tests whether at least one array element in a provided array passes a test implemented by a predicate function, while iterating from @@ -27,9 +28,9 @@ Examples -------- - > function isPositive( v ) { return ( v > 0 ); }; + > function predicate( v ) { return ( v > 0 ); }; > var x = [ 1, 1, 0, 0, 0 ]; - > var y = {{alias}}( x, isPositive ) + > var y = {{alias}}( x, predicate ) [ false, false, false, true, true ] @@ -71,10 +72,10 @@ Examples -------- - > function isPositive( v ) { return ( v > 0 ); }; > var x = [ 1, 1, 0, 0 ]; > var out = [ false, null, false, null, false, null, false, null ]; - > var arr = {{alias}}.assign( x, out, 2, 0, isPositive ) + > function predicate( v ) { return ( v > 0 ); }; + > var arr = {{alias}}.assign( x, out, 2, 0, predicate ) [ false, null, ..., true, null ] > var bool = ( arr === out ) true diff --git a/lib/node_modules/@stdlib/array/base/cuany-by-right/docs/types/index.d.ts b/lib/node_modules/@stdlib/array/base/cuany-by-right/docs/types/index.d.ts index 33524ad8710..67614773338 100644 --- a/lib/node_modules/@stdlib/array/base/cuany-by-right/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/array/base/cuany-by-right/docs/types/index.d.ts @@ -100,7 +100,7 @@ interface CuanyByRight { * * @example * function isPositive( v ) { - * return v > 0; + * return v > 0; * } * var x = [ 1, 1, 0, 0, 0 ]; * var y = [ false, null, false, null, false, null, false, null, false, null ]; @@ -172,7 +172,7 @@ interface CuanyByRight { * * @example * function isPositive( v ) { -* return v > 0; +* return v > 0; * } * var x = [ 1, 1, 0, 0, 0 ]; * @@ -181,7 +181,7 @@ interface CuanyByRight { * * @example * function isPositive( v ) { -* return v > 0; +* return v > 0; * } * var x = [ 0, 1, 1, 0, 0 ]; * var y = [ false, null, false, null, false, null, false, null, false, null ]; diff --git a/lib/node_modules/@stdlib/array/base/cuany-by-right/docs/types/test.ts b/lib/node_modules/@stdlib/array/base/cuany-by-right/docs/types/test.ts index e1689bd3bc0..d8aeccfb0d8 100644 --- a/lib/node_modules/@stdlib/array/base/cuany-by-right/docs/types/test.ts +++ b/lib/node_modules/@stdlib/array/base/cuany-by-right/docs/types/test.ts @@ -16,7 +16,6 @@ * limitations under the License. */ - import cuanyByRight = require( './index' ); /** @@ -57,7 +56,24 @@ function isPositive( value: number ): boolean { cuanyByRight( new Uint8ClampedArray( [ 1, 2, 3 ] ), isPositive, {} ); // $ExpectType boolean[] } -// The compiler throws an error if the function is provided a first argument which is not like a function.. +// The compiler throws an error if the function is provided a first argument which is not an array-like object... +{ + cuanyByRight( 1, isPositive ); // $ExpectError + cuanyByRight( true, isPositive ); // $ExpectError + cuanyByRight( false, isPositive ); // $ExpectError + cuanyByRight( null, isPositive ); // $ExpectError + cuanyByRight( void 0, isPositive ); // $ExpectError + cuanyByRight( {}, isPositive ); // $ExpectError + + cuanyByRight( 1, isPositive, {} ); // $ExpectError + cuanyByRight( true, isPositive, {} ); // $ExpectError + cuanyByRight( false, isPositive, {} ); // $ExpectError + cuanyByRight( null, isPositive, {} ); // $ExpectError + cuanyByRight( void 0, isPositive, {} ); // $ExpectError + cuanyByRight( {}, isPositive, {} ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not function... { const x = [ 1, 2, 3, 4 ]; @@ -87,7 +103,7 @@ function isPositive( value: number ): boolean { const y = [ false, null, false, null, false, null, false, null, false, null ]; cuanyByRight.assign( x, y, 2, 0, isPositive ); // $ExpectType (boolean | null)[] - cuanyByRight.assign( x, y, 2, 0, isPositive, {} ); // $ExpectType (boolean | null)[] + cuanyByRight.assign( x, y, 2, 0, isPositive, {} ); // $ExpectType (boolean | null)[] cuanyByRight.assign( x, new Float64Array( 4 ), 1, 0, isPositive ); // $ExpectType Float64Array cuanyByRight.assign( x, new Float32Array( 4 ), 1, 0, isPositive ); // $ExpectType Float32Array cuanyByRight.assign( x, new Int32Array( 4 ), 1, 0, isPositive ); // $ExpectType Int32Array @@ -148,7 +164,6 @@ function isPositive( value: number ): boolean { cuanyByRight.assign( x, {}, 2, 0, isPositive, {} ); // $ExpectError } - // The compiler throws an error if the `assign` method is provided a third argument which is not a number... { const x = [ false, false, true, false, false ]; @@ -193,7 +208,7 @@ function isPositive( value: number ): boolean { cuanyByRight.assign( x, y, 1, [], isPositive, {} ); // $ExpectError } -// The compiler throws an error if the `assign` method is provided a fourth argument which is not like a function... +// The compiler throws an error if the `assign` method is provided a fifth argument which is not like a function... { const x = [ false, false, true, false, false ]; const y = [ false, null, false, null, false, null, false, null, false, null ]; diff --git a/lib/node_modules/@stdlib/array/base/cuany-by-right/lib/index.js b/lib/node_modules/@stdlib/array/base/cuany-by-right/lib/index.js index e7108cf8493..43e6fa6e9a5 100644 --- a/lib/node_modules/@stdlib/array/base/cuany-by-right/lib/index.js +++ b/lib/node_modules/@stdlib/array/base/cuany-by-right/lib/index.js @@ -44,14 +44,11 @@ * * var x = [ 0, 1, 0, 0, 0 ]; * -* var y1 = cuanyByRight( x, isPositive ); -* // returns [ false, false, false, true, true ] -* -* var y2 = [ false, null, false, null, false, null, false, null, false, null ]; -* var out = cuanyByRight.assign( x, y2, 2, 0, isPositive ); +* var y = [ false, null, false, null, false, null, false, null, false, null ]; +* var out = cuanyByRight.assign( x, y, 2, 0, isPositive ); * // returns [ false, null, false, null, false, null, true, null, true, null ] * -* var bool = ( out === y2 ); +* var bool = ( out === y ); * // returns true */