import type { NumberLiteral } from '../number-literal'; import type { Stringify } from '../stringify'; export type TrimNumberLiteral = Stringify extends `${0}` ? '0' : PositiveRational>>; type PositiveRational = HandleLeadingZeroIntegral, Fractional>>; type HandleLeadingZeroIntegral = Stringify extends `${0}${infer _R extends 0}${infer R2}` ? R2 : N extends '' ? '0' : N; type Whole = N extends `0${infer N2}` ? Whole<`${N2}`> : N; type Fractional = N extends `${infer I}.` ? `${I}` : N extends `${infer I}.${infer F}` ? `${F}` extends `${infer F2}0` ? Fractional<`${I}.${F2}`> : N : never; type NoDecimalWithoutLeadingZero = N extends `.${infer F}` ? `0.${F}` : N; type IfWhole = `${N & string}` extends `${infer _I}.${infer _F}` ? Else : Then; export {};