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

25 lines
845 B
TypeScript

// Loaded from https://raw.githubusercontent.com/colinhacks/zod/654680afc2ede388e71e09104eac5a0088fe3207/deno/lib/types/unknown.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 ZodUnknownDef extends ZodTypeDef {
t: ZodTypes.unknown;
}
export class ZodUnknown extends ZodType<unknown, ZodUnknownDef> {
// 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 = (): ZodUnknown => {
return new ZodUnknown({
t: ZodTypes.unknown,
});
};
}