Open shaKY-iota opened 2 years ago
// your answers type Absolute<T extends number | string | bigint> = T extends number | bigint ? Absolute<`${T}`> : T extends `-${infer U}` ? U : T
https://github.com/type-challenges/type-challenges/issues/2869#issue-980383262
type Absolute<T extends number | string | bigint> = `${T}` extends `-${infer U}` ? U : `${T}`