from
Validates an unknown value as a matrix and returns a key-ascending shallow clone.
API Reference
Signature
Parameters
Returns
A new matrix with keys ascending and each row copied. Cell values are not deep-copied. Symbol keys and non-enumerable properties are dropped.
Throws
MATRIX_INVALID_MATRIX— value is not a plain object, a row is not an array, a row is sparse, or input is an array / function /Date/Map/Set/ class instance.
Agent Contract
Agent Notes
- Use
fromat the boundary of unknown/external data; for copying a value you already know is a matrix, use clone. - For a non-cloning check or assertion, use isMatrix / assertMatrix.
- Represent missing cells as explicit
undefined; sparse arrays are rejected.