feat(overload): Use typescript-rtti to select implementations #4

Merged
glen merged 2 commits from stepfour into main 2022-09-25 20:02:01 +00:00
Showing only changes of commit 54d7d01bfc - Show all commits

View File

@ -6,7 +6,10 @@ const adder = overload([
throw new TypeError('Can only add numbers')
},
(x: string, y: string) => 'Yay' + x + y
])
] as const)
console.log(adder(1, 2))
console.log(adder('a', 'b'))
//@ts-expect-error
console.log(adder(3n, 4n))