Skip to content

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

Closed

Description

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

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    AcceptedRFC feature request which has been accepted.FeatureIssue or pull request for adding a new feature.Good First IssueA good first issue for new contributors!JavaScriptIssue involves or relates to JavaScript.RFCRequest for comments. Feature requests and proposed changes.difficulty: 2May require some initial design or R&D, but should be straightforward to resolve and/or implement.priority: NormalNormal priority concern or feature request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions