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

14 lines
451 B
TypeScript

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