stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

[RFC]: add `@stdlib/array/base/cunone-by`

Open kgryte opened this issue 1 year ago • 2 comments

Description

This RFC proposes adding the package @stdlib/array/base/cunone-by, which cumulatively tests whether no array element in a provided array passes a test implemented by a predicate function. The function should return a new generic array. The package should also provide an #assign API for setting output values in a provided output array.

function isPositive( value ) {
	return ( value > 0 );
}

var x = [ 0, 0, 0, 1, 0 ];

var y1 = cunoneBy( x, isPositive );
// returns [ true, true, true, false, false ]

var y2 = [ false, null, false, null, false, null, false, null, false, null ];
var out = cunoneBy.assign( x, y2, 2, 0, isPositive );
// returns [ true, null, true, null, true, null, false, null, false, null ]

var bool = ( out === y2 );
// returns true

where the assign API supports an offset and stride (see, e.g., @stdlib/array/base/take).

Both APIs should support accessor arrays (see, e.g., @stdlib/array/base/take).

Related Issues

No.

Questions

No.

Other

  • See also @stdlib/array/base/none-by

Checklist

  • [X] I have read and understood the Code of Conduct.
  • [X] Searched for existing issues and pull requests.
  • [X] The issue name begins with RFC:.

kgryte avatar Jun 08 '24 00:06 kgryte

@kgryte May I work on this!!?

@Naresh-kumar-Thodupunoori Thank you for volunteering to work on this. Please feel free to submit a PR implementing this feature.

Also, as this is your first contribution, please only volunteer to work on one issue at a time. Based on our experience, contributors who attempt to work on multiple issues without first having gone through the review process are highly unlikely to ultimately be successful.

kgryte avatar Jul 16 '24 21:07 kgryte