Skip to content

[RFC]: add @stdlib/assert/is-ragged-nested-array #1347

Closed
@kgryte

Description

@kgryte

Description

This RFC proposes adding the package @stdlib/assert/is-ragged-nested-array.

The package should be similar in structure to @stdlib/assert/is-array-like-object.

A ragged nested array is a nested array having inner dimensions of varying lengths. E.g.,

[
  [ 1, 2, 3 ],
  [ 4, 5 ]
]

is a ragged nested array.

function isRaggedNestedArray( value ) { ... }

Package: @stdlib/assert/is-ragged-nested-array
Alias: isRaggedNestedArray

Related Issues

None.

Questions

  • Should this package only check for two-dimensional ragged arrays (i.e., an array of arrays)? Or should it recurse and check at each potential inner nested array depth?

Answer: we should only support two-dimensional nested arrays.

  • Should we require strict Array instances or are array-like objects okay?

Answer: we should not use isArray, but isArrayLikeObject. In order for a value to be a nested ragged array, the input value must be an array-like object and each element must be an array-like object and at least one element must have a length which differs from another element.

Other

No.

Checklist

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

Metadata

Metadata

Assignees

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.UtilitiesIssue or pull request concerning general utilities.difficulty: 1Low degree of difficulty. Should be straightforward to implement and/or resolve.priority: LowLow 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