Rocky_Mountain_Vending/.pnpm-store/v10/files/72/968dabc791339aa16ce0fcf143df07778babbd65b895ed67faf5b1ad03a2898e7b7b464fd069b407f76f79501eac8b1a1c1b067b1e43dec274d9b05b7111b8
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

41 lines
765 B
Text

/**
Returns a boolean for whether the given number is a float, like `1.5` or `-1.5`.
Use-case:
- If you want to make a conditional branch based on the result of whether a number is a float or not.
@example
```
import type {IsFloat, PositiveInfinity} from "type-fest";
type A = IsFloat<1.5>;
//=> true
type B = IsFloat<-1.5>;
//=> true
type C = IsFloat<1e-7>;
//=> true
type D = IsFloat<1.0>;
//=> false
type E = IsFloat<PositiveInfinity>;
//=> false
type F = IsFloat<1.23e+21>;
//=> false
```
@category Type Guard
@category Numeric
*/
export type IsFloat<T> = T extends number
? `${T}` extends `${number}e${infer E extends '-' | '+'}${number}`
? E extends '-'
? true
: false
: `${T}` extends `${number}.${number}`
? true
: false
: false;