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

14 lines
446 B
TypeScript

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