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

14 lines
450 B
TypeScript

// Loaded from https://deno.land/x/validasaur/src/rules/date_before.ts
import type { Validity, Rule } from "../types.ts";
import { clearTimes, dateChecks } from "../utils.ts";
export function dateBefore(date: Date): Rule {
return function dateBeforeRule(value: any): Validity {
return dateChecks(value, "dateBefore", { date }, (input: Date): boolean => {
return clearTimes(input).getTime() < clearTimes(date).getTime();
});
};
}