diff --git a/lib/node_modules/@stdlib/ndarray/any-by/README.md b/lib/node_modules/@stdlib/ndarray/any-by/README.md index 489f2dfcb18a..d50353ce4b0b 100644 --- a/lib/node_modules/@stdlib/ndarray/any-by/README.md +++ b/lib/node_modules/@stdlib/ndarray/any-by/README.md @@ -52,10 +52,7 @@ var x = array( [ [ 1.0, -2.0 ], [ 3.0, -4.0 ] ] ); // Test whether at least one element is positive: var out = anyBy( x, isPositive ); -// returns - -var v = out.get(); -// returns true +// returns [ true ] ``` The function accepts the following arguments: @@ -73,7 +70,6 @@ The function accepts the following options: By default, the function performs a reduction over all elements in a provided [`ndarray`][@stdlib/ndarray/ctor]. To reduce specific dimensions, set the `dims` option. ```javascript -var ndarray2array = require( '@stdlib/ndarray/to-array' ); var array = require( '@stdlib/ndarray/array' ); function isPositive( value ) { @@ -82,6 +78,7 @@ function isPositive( value ) { // Create an input ndarray: var x = array( [ [ 1.0, 2.0 ], [ -3.0, -4.0 ] ] ); +// returns var opts = { 'dims': [ 1 ] @@ -89,16 +86,12 @@ var opts = { // Perform reduction: var out = anyBy( x, opts, isPositive ); -// returns - -var v = ndarray2array( out ); -// returns [ true, false ] +// returns [ true, false ] ``` By default, the function returns an [`ndarray`][@stdlib/ndarray/ctor] having a shape matching only the non-reduced dimensions of the input [`ndarray`][@stdlib/ndarray/ctor] (i.e., the reduced dimensions are dropped). To include the reduced dimensions as singleton dimensions in the output [`ndarray`][@stdlib/ndarray/ctor], set the `keepdims` option to `true`. ```javascript -var ndarray2array = require( '@stdlib/ndarray/to-array' ); var array = require( '@stdlib/ndarray/array' ); function isPositive( value ) { @@ -114,10 +107,7 @@ var opts = { // Perform reduction: var out = anyBy( x, opts, isPositive ); -// returns - -var v = ndarray2array( out ); -// returns [ [ [ true ] ] ] +// returns [ [ true ] ] ``` To set the function execution context, provide a `thisArg`. @@ -141,10 +131,7 @@ var ctx = { // Perform reduction: var out = anyBy( x, isPositive, ctx ); -// returns - -var v = out.get(); -// returns true +// returns [ true ] var count = ctx.count; // returns 4 @@ -172,10 +159,7 @@ var y = empty( [], { // Perform reduction: var out = anyBy.assign( x, y, isPositive ); -// returns - -var v = out.get(); -// returns true +// returns [ true ] var bool = ( out === y ); // returns true @@ -198,7 +182,6 @@ By default, the function performs a reduction over all elements in a provided [` ```javascript var array = require( '@stdlib/ndarray/array' ); var empty = require( '@stdlib/ndarray/empty' ); -var ndarray2array = require( '@stdlib/ndarray/to-array' ); function predicate( value ) { return value > 0.0; @@ -219,12 +202,10 @@ var opts = { // Perform reduction: var out = anyBy.assign( x, y, opts, predicate ); +// returns [ true, false ] var bool = ( out === y ); // returns true - -var v = ndarray2array( y ); -// returns [ true, false ] ``` diff --git a/lib/node_modules/@stdlib/ndarray/any-by/docs/repl.txt b/lib/node_modules/@stdlib/ndarray/any-by/docs/repl.txt index aecb2c595bbe..955c6fa1b679 100644 --- a/lib/node_modules/@stdlib/ndarray/any-by/docs/repl.txt +++ b/lib/node_modules/@stdlib/ndarray/any-by/docs/repl.txt @@ -38,9 +38,7 @@ > function f( v ) { return v > 0.0; }; > var out = {{alias}}( x, f ) - - > out.get() - true + [ true ] {{alias}}.assign( x, y[, options], predicate[, thisArg] ) @@ -84,11 +82,9 @@ > function f( v ) { return v > 0.0; }; > var out = {{alias}}.assign( x, y, f ) - + [ true ] > var bool = ( y === out ) true - > out.get() - true See Also -------- diff --git a/lib/node_modules/@stdlib/ndarray/any-by/docs/types/index.d.ts b/lib/node_modules/@stdlib/ndarray/any-by/docs/types/index.d.ts index f4e199cc124b..986e7e89c86f 100644 --- a/lib/node_modules/@stdlib/ndarray/any-by/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/ndarray/any-by/docs/types/index.d.ts @@ -129,10 +129,7 @@ interface AnyBy { * * // Perform reduction: * var out = anyBy( x, isPositive ); - * // returns - * - * var v = out.get(); - * // returns true + * // returns [ true ] */ = InputArray, ThisArg = unknown>( x: U, predicate: Predicate, thisArg?: ThisParameterType> ): boolndarray; @@ -172,10 +169,7 @@ interface AnyBy { * * // Perform reduction: * var out = anyBy( x, {}, isPositive ); - * // returns - * - * var v = out.get(); - * // returns true + * // returns [ true ] */ = InputArray, ThisArg = unknown>( x: U, options: Options, predicate: Predicate, thisArg?: ThisParameterType> ): boolndarray; @@ -219,10 +213,7 @@ interface AnyBy { * * // Perform reduction: * var out = anyBy.assign( x, y, isPositive ); - * // returns - * - * var v = out.get(); - * // returns true + * // returns [ true ] */ assign = InputArray, V extends ndarray = ndarray, ThisArg = unknown>( x: U, y: V, predicate: Predicate, thisArg?: ThisParameterType> ): V; @@ -268,10 +259,7 @@ interface AnyBy { * * // Perform reduction: * var out = anyBy.assign( x, y, {}, isPositive ); - * // returns - * - * var v = out.get(); - * // returns true + * // returns [ true ] */ assign = InputArray, V extends ndarray = ndarray, ThisArg = unknown>( x: U, y: V, options: BaseOptions, predicate: Predicate, thisArg?: ThisParameterType> ): V; } @@ -312,10 +300,7 @@ interface AnyBy { * * // Perform reduction: * var out = anyBy( x, isPositive ); -* // returns -* -* var v = out.get(); -* // returns true +* // returns [ true ] * * @example * var Float64Array = require( '@stdlib/array/float64' ); @@ -348,10 +333,7 @@ interface AnyBy { * * // Perform reduction: * var out = anyBy.assign( x, y, isPositive ); -* // returns -* -* var v = out.get(); -* // returns true +* // returns [ true ] */ declare var anyBy: AnyBy; diff --git a/lib/node_modules/@stdlib/ndarray/any-by/lib/assign.js b/lib/node_modules/@stdlib/ndarray/any-by/lib/assign.js index 5aa59b057486..901e5a69f2ce 100644 --- a/lib/node_modules/@stdlib/ndarray/any-by/lib/assign.js +++ b/lib/node_modules/@stdlib/ndarray/any-by/lib/assign.js @@ -81,13 +81,10 @@ var validate = require( './validate.js' ); * * // Perform reduction: * var out = assign( x, y, isPositive ); -* // returns +* // returns [ true] * * var bool = ( out === y ); * // returns true -* -* var v = out.get(); -* // returns true */ function assign( x, y, options, predicate, thisArg ) { var nargs; diff --git a/lib/node_modules/@stdlib/ndarray/any-by/lib/index.js b/lib/node_modules/@stdlib/ndarray/any-by/lib/index.js index e3d78f200281..d290a1af953b 100644 --- a/lib/node_modules/@stdlib/ndarray/any-by/lib/index.js +++ b/lib/node_modules/@stdlib/ndarray/any-by/lib/index.js @@ -49,10 +49,7 @@ * * // Perform reduction: * var out = anyBy( x, isPositive ); -* // returns -* -* var v = out.get(); -* // returns true +* // returns [ true ] * * @example * var Float64Array = require( '@stdlib/array/float64' ); @@ -86,10 +83,7 @@ * * // Perform reduction: * var out = anyBy.assign( x, y, isPositive ); -* // returns -* -* var v = out.get(); -* // returns true +* // returns [ true ] */ // MODULES // diff --git a/lib/node_modules/@stdlib/ndarray/any-by/lib/main.js b/lib/node_modules/@stdlib/ndarray/any-by/lib/main.js index c77897def246..3132dc800119 100644 --- a/lib/node_modules/@stdlib/ndarray/any-by/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/any-by/lib/main.js @@ -86,10 +86,7 @@ var validate = require( './validate.js' ); * * // Perform reduction: * var out = anyBy( x, isPositive ); -* // returns -* -* var v = out.get(); -* // returns true +* // returns [ true ] */ function anyBy( x, options, predicate, thisArg ) { var nargs;