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