From 4628c352565df06f0733a9f273c557dd78af34b3 Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Thu, 12 May 2022 01:02:13 -0700 Subject: [PATCH] Improve styling --- README.md | 39 +++++++++++++++++++-------------------- index.html | 7 ++++--- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 4d75dcefc..0dc79396a 100644 --- a/README.md +++ b/README.md @@ -1257,7 +1257,7 @@ type myFunction = z.infer; // => ()=>unknown ``` -**Define inputs and output** +Define inputs and outputs. ```ts const myFunction = z @@ -1268,24 +1268,6 @@ type myFunction = z.infer; // => (arg0: string, arg1: number)=>boolean ``` -**Extract the input and output schemas** -You can extract the parameters and return type of a function schema. - -```ts -myFunction.parameters(); -// => ZodTuple<[ZodString, ZodNumber]> - -myFunction.returnType(); -// => ZodBoolean -``` - - - -> You can use the special `z.void()` option if your function doesn't return anything. This will let Zod properly infer the type of void-returning functions. (Void-returning functions actually return undefined.) - + ## Preprocess Typically Zod operates under a "parse then transform" paradigm. Zod validates the input first, then passes it through a chain of transformation functions. (For more information about transforms, read the [.transform docs](#transform).) diff --git a/index.html b/index.html index 5bed7a365..b3ab474ae 100644 --- a/index.html +++ b/index.html @@ -19,13 +19,14 @@ } .markdown-section h2 { padding: 40px 0px 10px 0px; + border-bottom: 1px solid #dbdbdb; } .markdown-section h3 { - padding: 15px 0px 10px 0px; + padding-top: 15px; } - .markdown-section h4 { - padding: 15px 0px 5px 0px; + .markdown-section h3 code { + font-size: 80%; }