UNPKG

matrix-transpose

Version:

Transposes a matrix by switching the row and column indices of a multidimensional array.

3 lines (2 loc) 546 B
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).MatrixTranspose={})}(this,(function(e){"use strict";e.transpose=function(e,t){void 0===t&&(t={});for(var o=e.length,n=[],f=t.excludeEmpty,i=0;i<o;i++)for(var r=e[i],s=r.length,d=0;d<s;d++){var u=r[d];n[d]=n[d]||[],f?n[d].push(u):n[d][i]=u}return n},Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=matrix-transpose.min.js.map