Closed
Description
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
RFC feature request which has been accepted.Issue or pull request for adding a new feature.A good first issue for new contributors!Issue involves or relates to JavaScript.Request for comments. Feature requests and proposed changes.Issue or pull request concerning general utilities.Low degree of difficulty. Should be straightforward to implement and/or resolve.Low priority concern or feature request.