Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Sep 22, 2024
1 parent c200c85 commit c17a0bf
Show file tree
Hide file tree
Showing 18 changed files with 238 additions and 183 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ A total of 5 people contributed to this release. Thank you to the following cont

<details>

- [`b723a6e`](https://github.com/stdlib-js/stdlib/commit/b723a6eaec97adad2da4ffbecb532a3d1ae1e0ba) - **docs:** fix errors in comments and clean-up _(by Philipp Burckhardt)_
- [`eb82943`](https://github.com/stdlib-js/stdlib/commit/eb82943ec2ac2b3023377cbc320486d333f47e48) - **chore:** minor clean-up _(by Philipp Burckhardt)_
- [`3c8bcb9`](https://github.com/stdlib-js/stdlib/commit/3c8bcb938befe35d784ba3fe0dea124dd4b20b36) - **chore:** minor clean-up _(by Philipp Burckhardt)_
- [`177f16c`](https://github.com/stdlib-js/stdlib/commit/177f16cd80b9072714e7b4e976487e5e6dd19761) - **chore:** update package meta data [(#2933)](https://github.com/stdlib-js/stdlib/pull/2933) _(by stdlib-bot, Athan Reines)_
- [`7d3199f`](https://github.com/stdlib-js/stdlib/commit/7d3199f4d91ad317802d62e4557f75b36b9f7748) - **docs:** remove duplicate horizontal line _(by Athan Reines)_
- [`7a92103`](https://github.com/stdlib-js/stdlib/commit/7a92103ded645aa971bbac7544cafe24652fd5bd) - **docs:** update copy _(by Athan Reines)_
Expand Down
42 changes: 21 additions & 21 deletions base/cunone-by-right/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ limitations under the License.

# cunoneByRight

> Cumulatively test whether no array element in a provided array passes a test implemented by a predicate function, while iterating from right-to-left.
> Cumulatively test whether every array element in a provided array fails a test implemented by a predicate function, while iterating from right-to-left.
<section class="usage">

Expand All @@ -32,7 +32,7 @@ var cunoneByRight = require( '@stdlib/array/base/cunone-by-right' );

#### cunoneByRight( x, predicate\[, thisArg ] )

Cumulatively tests whether no array element in a provided array passes a test implemented by a `predicate` function, while iterating from right-to-left.
Cumulatively tests whether every array element in a provided array fails a test implemented by a `predicate` function, while iterating from right-to-left.

```javascript
function fcn( value ) {
Expand All @@ -45,25 +45,6 @@ var y = cunoneByRight( x, fcn );
// returns [ true, true, true, false, false ];
```

#### cunoneByRight.assign( x, out, stride, offset, predicate\[, thisArg ] )

Cumulatively tests whether no array element in a provided array passes a test implemented by a `predicate` function, while iterating from right-to-left, and assigns the results to the elements in the output array.

```javascript
function fcn( v ) {
return v > 0;
}

var x = [ 1, 1, 0, 0, 0 ];
var y = [ false, null, false, null, false, null, false, null, false, null ];

var out = cunoneByRight.assign( x, y, 2, 0, fcn );
// returns [ true, null, true, null, true, null, false, null, false, null ]

var bool = ( out === y );
// returns true
```

The invoked `predicate` function is provided three arguments:

- **value**: collection element.
Expand Down Expand Up @@ -91,6 +72,25 @@ var count = context.count;
// returns 4
```

#### cunoneByRight.assign( x, out, stride, offset, predicate\[, thisArg ] )

Cumulatively test whether every array element in a provided array fails a test implemented by a `predicate` function, while iterating from right-to-left, and assigns the results to the elements in the output array.

```javascript
function fcn( v ) {
return v > 0;
}

var x = [ 1, 1, 0, 0, 0 ];
var y = [ false, null, false, null, false, null, false, null, false, null ];

var out = cunoneByRight.assign( x, y, 2, 0, fcn );
// returns [ true, null, true, null, true, null, false, null, false, null ]

var bool = ( out === y );
// returns true
```

</section>

<!-- /.usage -->
Expand Down
12 changes: 6 additions & 6 deletions base/cunone-by-right/docs/repl.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

{{alias}}( x, predicate[, thisArg] )
Cumulatively tests whether no array element in a provided array passes a
test implemented by a predicate function, while iterating from
right-to-left.
Cumulatively tests whether every array element in a provided array fails a
test implemented by a predicate function, while iterating from right-to-
left.

The predicate function is provided three arguments:

Expand Down Expand Up @@ -35,9 +35,9 @@


{{alias}}.assign( x, out, stride, offset, predicate[, thisArg] )
Cumulatively tests whether no array element in a provided array passes a
test implemented by a predicate function, while iterating from
right-to-left, and assign the results to the provided output array.
Cumulatively tests whether every array element in a provided array fails a
test implemented by a predicate function, while iterating from right-to-
left, and assigns the results to the provided output array.

The predicate function is provided three arguments:

Expand Down
10 changes: 5 additions & 5 deletions base/cunone-by-right/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type Predicate<T, U> = Nullary<U> | Unary<T, U> | Binary<T, U> | Ternary<T, U>;
*/
interface CunoneByRight {
/**
* Cumulatively test whether no array element in a provided array passes a test implemented by a predicate function, while iterating from right-to-left.
* Cumulatively tests whether every array element in a provided array fails a test implemented by a predicate function, while iterating from right-to-left.
*
* @param x - input array
* @param predicate - test function
Expand All @@ -90,7 +90,7 @@ interface CunoneByRight {
<T = unknown, U = unknown>( x: Collection<T> | AccessorArrayLike<T>, predicate: Predicate<T, U>, thisArg?: ThisParameterType<Predicate<T, U>> ): Array<boolean>;

/**
* Cumulatively tests whether no array element in a provided array passes a test implemented by a predicate function, while iterating from right-to-left, and assigns the results to the provided output array.
* Cumulatively tests whether every array element in a provided array fails a test implemented by a predicate function, while iterating from right-to-left, and assigns the results to the provided output array.
*
* @param x - input array
* @param y - output array
Expand All @@ -113,7 +113,7 @@ interface CunoneByRight {
assign<T = unknown, U = unknown, V = unknown>( x: Collection<T> | AccessorArrayLike<T>, out: Array<U>, stride: number, offset: number, predicate: Predicate<T, V>, thisArg?: ThisParameterType<Predicate<T, V>> ): Array<U | boolean>;

/**
* Cumulatively tests whether no array element in a provided array passes a test implemented by a predicate function, while iterating from right-to-left, and assigns the results to the provided output array.
* Cumulatively tests whether every array element in a provided array fails a test implemented by a predicate function, while iterating from right-to-left, and assigns the results to the provided output array.
*
* @param x - input array
* @param out - output array
Expand Down Expand Up @@ -141,7 +141,7 @@ interface CunoneByRight {
assign<T, U extends TypedArray | BooleanArray, V = unknown>( x: Collection<T> | AccessorArrayLike<T>, out: U, stride: number, offset: number, predicate: Predicate<T, V>, thisArg?: ThisParameterType<Predicate<T, V>> ): U;

/**
* Cumulatively tests whether no array element in a provided array passes a test implemented by a predicate function, while iterating from right-to-left, and assigns the results to the provided output array.
* Cumulatively tests whether every array element in a provided array fails a test implemented by a predicate function, while iterating from right-to-left, and assigns the results to the provided output array.
*
* @param x - input array
* @param out - output array
Expand All @@ -158,7 +158,7 @@ interface CunoneByRight {
* var x = [ 0, 0, 0, 1, 0 ];
* var y = [ false, null, false, null, false, null, false, null, false, null ];
*
* var arr = cunoneBy.cunoneByRight( x, y, 2, 0, isPositive );,
* var arr = cunoneBy.assign( x, y, 2, 0, isPositive );,
* // returns [ true, null, false, null, false, null, false, null, false, null ]
*/
assign<T = unknown, U = unknown, V = unknown>( x: Collection<T> | AccessorArrayLike<T>, out: Collection<U> | AccessorArrayLike<U>, stride: number, offset: number, predicate: Predicate<T, V>, thisArg?: ThisParameterType<Predicate<T, V>> ): Collection<U | boolean> | AccessorArrayLike<U | boolean>;
Expand Down
15 changes: 7 additions & 8 deletions base/cunone-by-right/lib/assign.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ var arraylike2object = require( './../../../base/arraylike2object' );
// FUNCTIONS //

/**
* Cumulatively tests whether no element in a provided array passes a test implemented by a predicate function, while iterating from right-to-left, and assigns the results to elements in the provided output array.
* Cumulatively tests whether every array element in a provided array fails a test implemented by a predicate function, while iterating from right-to-left, and assigns the results to elements in the provided output array.
*
* @private
* @param {Collection} x - input array
* @param {Collection} out - output array
* @param {integer} stride - output array stride
* @param {NonNegativeInteger} offset - output array offset
* @param {Function} predicate - test function
* @param {*} [thisArg] - execution context
* @param {*} thisArg - execution context
* @returns {Collection} output array
*
* @example
Expand All @@ -56,7 +56,7 @@ function indexed( x, out, stride, offset, predicate, thisArg ) {
flg = true;
io = offset;
for ( i = x.length - 1; i >= 0; i-- ) {
if ( flg === true && predicate.call( thisArg, x[ i ], i, x ) ) {
if ( flg && predicate.call( thisArg, x[ i ], i, x ) ) {
flg = false;
}
out[ io ] = flg;
Expand All @@ -66,15 +66,15 @@ function indexed( x, out, stride, offset, predicate, thisArg ) {
}

/**
* Cumulatively tests whether no element in a provided accessor array passes a test implemented by a predicate function, while iterating from right-to-left, and assigns the results to elements in the accessor output array.
* Cumulatively tests whether every array element in a provided array fails a test implemented by a predicate function, while iterating from right-to-left, and assigns the results to elements in the accessor output array.
*
* @private
* @param {Object} x - input array object
* @param {Object} out - output array object
* @param {integer} stride - output array stride
* @param {NonNegativeInteger} offset - output array offset
* @param {Function} predicate - test function
* @param {*} [thisArg] - execution context
* @param {*} thisArg - execution context
* @returns {Collection} output array
*
* @example
Expand Down Expand Up @@ -111,8 +111,7 @@ function accessors( x, out, stride, offset, predicate, thisArg ) {
io = offset;
flg = true;
for ( i = xdata.length - 1; i >= 0; i-- ) {
if ( flg === true &&
predicate.call( thisArg, xget( xdata, i ), i, xdata ) ) {
if ( flg && predicate.call( thisArg, xget( xdata, i ), i, xdata ) ) {
flg = false;
}
oset( odata, io, flg );
Expand All @@ -125,7 +124,7 @@ function accessors( x, out, stride, offset, predicate, thisArg ) {
// MAIN //

/**
* Cumulatively tests whether no element in a provided array passes a test implemented by a predicate function, while iterating from right-to-left, and assigns the results to elements in the output array.
* Cumulatively tests whether every array element in a provided array fails a test implemented by a predicate function, while iterating from right-to-left, and assigns the results to elements in the output array.
*
* @param {Collection} x - input array
* @param {Collection} out - output array
Expand Down
2 changes: 1 addition & 1 deletion base/cunone-by-right/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'use strict';

/**
* Cumulatively test whether no element in a provided array passes a test implemented by a predicate function, while iterating from right-to-left.
* Cumulatively test whether every array element in a provided array fails a test implemented by a predicate function, while iterating from right-to-left.
*
* @module @stdlib/array/base/cunone-by-right
*
Expand Down
2 changes: 1 addition & 1 deletion base/cunone-by-right/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var assign = require( './assign.js' );
// MAIN //

/**
* Cumulatively tests whether no element in a provided array passes a test implemented by a predicate function, while iterating from right-to-left.
* Cumulatively tests whether every array element in a provided array fails a test implemented by a predicate function, while iterating from right-to-left.
*
* @param {Collection} x - input array
* @param {Function} predicate - test function
Expand Down
2 changes: 1 addition & 1 deletion base/cunone-by-right/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stdlib/array/base/cunone-by-right",
"version": "0.0.0",
"description": "Cumulatively test whether no array element in a provided array passes a test implemented by a predicate function, while iterating from right-to-left.",
"description": "Cumulatively test whether every array element in a provided array fails a test implemented by a predicate function, while iterating from right-to-left.",
"license": "Apache-2.0",
"author": {
"name": "The Stdlib Authors",
Expand Down
Loading

0 comments on commit c17a0bf

Please sign in to comment.