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

26 lines
801 B
TypeScript

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