swc/crates/swc_bundler/tests/.cache/deno/d22c66081a53eeae9b0f1f9faed126435d32375c.ts
2021-11-09 20:42:49 +09:00

14 lines
391 B
TypeScript

// Loaded from https://deno.land/x/validasaur/src/rules/max_number.ts
import type { Validity, Rule } from "../types.ts";
import { invalid } from "../utils.ts";
export function maxNumber(maxValue: number): Rule {
return function maxRule(value: any): Validity {
if (typeof value !== "number" || value > maxValue) {
return invalid("maxNumber", { value, maxValue });
}
};
}