Type alias NegativeIntegerString<S>

NegativeIntegerString<S>: IfEquals<IsNegativeInteger<Integer<NumerifyString<S>>>, true, Integer<NumerifyString<S>>, never>

Represents a negative integer parsed from a string. If the string does not represent a negative integer, it resolves to never, else it resolves to its integer representation.

Type Parameters

  • S extends string

Example

   NegativeIntegerString<'0'>; // never
NegativeIntegerString<'82739283293237'>; // never
NegativeIntegerString<'-82739.283293237'>; // works
NegativeIntegerString<'-82739.283293237'>; // never
NegativeIntegerString<'-1'>; // works