Skip to content

Commit

Permalink
feat(validators): add validator for valid Date object
Browse files Browse the repository at this point in the history
  • Loading branch information
TomokiMiyauci committed May 23, 2023
1 parent cd51c17 commit e347ae9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions validators/date/valid_date.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2023-latest Tomoki Miyauchi. All rights reserved. MIT license.
// This module is browser compatible.

import { isValidDate } from "../../deps.ts";
import { shouldBe } from "../utils.ts";
import { display, ScalarValidator } from "../../utils.ts";

@display("valid Date")
export class ValidDateValidator extends ScalarValidator<Date> {
constructor() {
super();
super.expect(shouldBe);
}

override is = isValidDate;
}

0 comments on commit e347ae9

Please sign in to comment.