Skip to content

Commit

Permalink
fixing type error on transpose func (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lrs-mtos authored Jan 27, 2024
1 parent 34acecb commit 0a6daeb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ export const ordered = (unordered: Record<string, any>) =>
return obj
}, {})

export function transpose(matrix: any[][]) {
const res = []
export function transpose<T>(matrix: T[][]): T[][] {
const res: T[][] = []
for (let i = 0; i < matrix[0].length; i++) {
res[i] = [] as any
res[i] = [] as T[]
for (let j = 0; j < matrix.length; j++) {
res[i][j] = matrix[j][i]
}
Expand Down

0 comments on commit 0a6daeb

Please sign in to comment.