mirror of
https://github.com/swc-project/swc.git
synced 2024-12-30 17:15:11 +03:00
25 lines
782 B
TypeScript
25 lines
782 B
TypeScript
|
// Loaded from https://raw.githubusercontent.com/colinhacks/zod/654680afc2ede388e71e09104eac5a0088fe3207/deno/lib/types/null.ts
|
||
|
|
||
|
|
||
|
import { ZodTypes } from "../ZodTypes.ts";
|
||
|
import { ZodType, ZodTypeDef } from "./base.ts";
|
||
|
// import { ZodUndefined } from './undefined';
|
||
|
// import { ZodUnion } from './union';
|
||
|
|
||
|
export interface ZodNullDef extends ZodTypeDef {
|
||
|
t: ZodTypes.null;
|
||
|
}
|
||
|
|
||
|
export class ZodNull extends ZodType<null, ZodNullDef> {
|
||
|
// 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 = (): ZodNull => {
|
||
|
return new ZodNull({
|
||
|
t: ZodTypes.null,
|
||
|
});
|
||
|
};
|
||
|
}
|