Skip to content

Commit

Permalink
Update typescript definition to be more precise
Browse files Browse the repository at this point in the history
Now any number of factors is supported. Each factor can have is own type
  • Loading branch information
Paulomart committed Dec 4, 2021
1 parent a7cc1e0 commit 6613ab2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
declare const fastCartesian: <T>(arrays: T[][]) => T[][]
declare const fastCartesian: <TFactors extends any[][]>(factors: [...TFactors]) => {
[TFactor in keyof TFactors]: TFactors[TFactor] extends Array<infer TUnArrayed> ? TUnArrayed : never
}[]

export default fastCartesian

0 comments on commit 6613ab2

Please sign in to comment.