Function createZodManager

  • Type Parameters

    Parameters

    • obj: Type

    Returns ZodManager<Type>

    Requires

    zod

    Powered by node:v8 and zod (as a peer dependency, please install it if you use it), with this value manager it is possible to save any serializable object, as well as perform type checking at runtime

    Example

    import { CacheManagers } from "@mateus-pires/file-cache";
    import z from "zod";

    const ZodManager = CacheManagers.Zod(
    z.object({ a: z.string().optional(), b: z.number() })
    );

    // cache: Cache<{ a?: string; b: number }>
    const cache = new Cache({ value_manager: ZodManager });

Generated using TypeDoc