swc/crates/swc_bundler/tests/.cache/deno/3b47c6e288064e57b13dba7271c3b6e0358e7565.ts

14 lines
450 B
TypeScript
Raw Normal View History

// 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();
});
};
}