mirror of
https://github.com/swc-project/swc.git
synced 2024-12-20 20:22:26 +03:00
12 lines
305 B
TypeScript
12 lines
305 B
TypeScript
|
// Loaded from https://deno.land/x/validasaur/src/rules/is_float.ts
|
||
|
|
||
|
|
||
|
import type { Validity } from "../types.ts";
|
||
|
import { invalid } from "../utils.ts";
|
||
|
|
||
|
export function isFloat(value: any): Validity {
|
||
|
if (typeof value !== "number" || value % 1 === 0) {
|
||
|
return invalid("isFloat", { value });
|
||
|
}
|
||
|
}
|