Releases: neefrehman/make-matrix
v4.0.3
v4.0.2
v4.0.1
v4.0.0
4.0.0 (2023-11-19)
BREAKING CHANGES
-
types: change
any[]tounknown[], if creating a matrix of dynamic size (#21)const createDynamicMatrix = (dimensions: number[]) => makeMatrix(dimensions, 0); // now returns unknown[]
This is a breaking change to how the library handles cases where a primitive, instead of a literal type, is used for the number of dimensions. Previously, the resulting Matrix would resolve to
any[], as the complier is unable to infer how it should be typed (other than that it must be an array). This allowed to compiler to avoid throwing atype instantiation is excessively deep error, but also introduced an implicitanyinto the user's codebase, which is less than ideal.Now, the library will return a type of
unknown[]in these cases. This achieves the same basic amount of type safety, but also means that users will not be able to use the resulting matrix in as many places asany[]would have allowed. The resulting matrix must now be typed by the caller. If you are able to provide more information than the compiler can infer. If not, then an explicit typing ofany[]will provide the most 'relaxed' experience.
v3.0.2
v3.0.1
v3.0.0
3.0.0 (2023-01-03)
Code Cleanup & Bundle Size Improvements
BREAKING CHANGES
- passing a number as the
dimensionsparameter—to create a matrix with a desired number of dimensions but a non-specific size—is no longer supported. This feature was rarely used, if ever, and was less performant. makeMatrixis no longer a default export of this package, please used a named import from this version on.
v2.3.3
v2.3.2
Bug Fixes
- Fix npm publish step