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

26 lines
819 B
TypeScript

// Loaded from https://raw.githubusercontent.com/colinhacks/zod/654680afc2ede388e71e09104eac5a0088fe3207/deno/lib/types/date.ts
import { ZodTypes } from "../ZodTypes.ts";
import { ZodType, ZodTypeDef } from "./base.ts";
// import { ZodUndefined } from './undefined';
// import { ZodNull } from './null';
// import { ZodUnion } from './union';
export interface ZodDateDef extends ZodTypeDef {
t: ZodTypes.date;
}
export class ZodDate extends ZodType<Date, ZodDateDef> {
// opt optional: () => ZodUnion<[this, ZodUndefined]> = () => ZodUnion.create([this, ZodUndefined.create()]);
// null nullable: () => ZodUnion<[this, ZodNull]> = () => ZodUnion.create([this, ZodNull.create()]);
toJSON = () => this._def;
static create = (): ZodDate => {
return new ZodDate({
t: ZodTypes.date,
});
};
}