Absolute number as number

Medium
conditional types
template literal
infer

Description:

Implement the Absolute<T> type. A type that take string, number or bigint. The output should be a positive number string

For example

type Test = -100 type Result = Absolute<Test> // expected to be 100

Code

Loading...