Zod v4 Type Registry Core (core/registries.ts)

openclaw-deploy · release-offline-fix/resources/bundled-node-modules/zod/src/v4/core/registries.ts · typescript · MIT
dev-tools, database, lang:typescript, fw:zod, tag:validation, tag:registry

Defines core registry types and metadata handling for Zod v4 schema validation library, supporting input/output type transformations. Reuse for schema registry implementations.

// Source: https://github.com/3445286649/openclaw-deploy | License: MIT | Copyright 2026 loucerd
// Provided via justclaw.it.com; keep this notice with the code.
import type * as core from "./core.js";
import type { $ZodType } from "./schemas.js";

export const $output: unique symbol = Symbol("ZodOutput");
export type $output = typeof $output;
export const $input: unique symbol = Symbol("ZodInput");
export type $input = typeof $input;

export type $replace<Meta, S extends $ZodType> = Meta extends $output
  ? core.output<S>
  : Meta extends $input
    ? core.input<S>
    : Meta extends (infer M)[]
      ? $replace<M, S>[]
      : Meta extends (...args: infer P) => infer R
        ? (
            ...args: {
              [K in keyof P]: $replace<P[K], S>; // tuple
            }
          ) =

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key