From d8d3806738fac67876b4ff9478b8f7a09ea6bc4a Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Fri, 13 May 2022 11:51:57 -0700 Subject: [PATCH] Add docs link (#1133) * Add docs link to readme * Add docs link to readme * Update ZH readme * Update readme Co-authored-by: Colin McDonnell --- README.md | 11 ++++++++--- README_ZH.md | 49 ++++++++++++++++++++++--------------------------- index.html | 16 ++++++++++++++-- 3 files changed, 44 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 51e3957d2..4d27fe47d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,11 @@

Zod logo

Zod

-

TypeScript-first schema validation with static type inference

+

+ ✨ https://zod.dev ✨ +
+ TypeScript-first schema validation with static type inference +


@@ -11,10 +15,11 @@ npm stars discord server -

+ Documentation +   •   Discord   •   NPM @@ -30,7 +35,7 @@

-These docs have been translated into [Chinese](./README_ZH.md). +> These docs have been translated into [Chinese](./README_ZH.md). ## Table of contents diff --git a/README_ZH.md b/README_ZH.md index 0ca2082c0..0fafdb4e7 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -1,42 +1,37 @@

- + Zod logo

Zod

+

TypeScript-first schema validation with static type inference +
+ https://zod.dev

+

+Zod CI status Created by Colin McDonnell License npm stars -coverage - -

-

-⭐️ smash that star button ⭐️ +discord server

-> 如果你喜欢 Zod,你会喜欢我的新库 [tRPC](https://trpc.io). 这是一种建立端到端类型安全 API 的方法,无需 GraphQL 或代码生成 请在[trpc.io](https://trpc.io)上查看他. +
+ Documentation +   •   + Discord +   •   + NPM +   •   + Issues +   •   + @colinhacks +   •   + tRPC +
+

- -## 二零二一年五月十七日: Zod v3 已经进入稳定版! - -查看 [迁移指南](https://github.com/colinhacks/zod/blob/master/MIGRATION.md) 进行升级. - -以前的版本: - -- [`Zod 1 docs`](https://github.com/colinhacks/zod/tree/v1) -- [`Zod 2 docs`](https://github.com/colinhacks/zod/tree/v2) - -#### 新功能 - -- **更容易的引入**: 你现在可以像`import { z } from 'zod';`那样导入 Zod,而不是使用`import * as`语法。 -- **结构化的错误消息**. 对 ZodError 使用`.format()`方法,将错误转换为强类型的嵌套对象: [format method](#error-formatting) -- **更容易的联合类型**. 使用 ZodType(所有 Zod 模式的基类)的`or`方法,可以轻松创建联合类型,如 `z.string().or(z.number())` -- **更容易的交叉类型**. 对 ZodType(所有 Zod 模式的基类)使用`and`方法,可以轻松创建交叉类型 -- **全局错误定制**. 使用`z.setErrorMap(myErrorMap)`来全面定制 Zod 产生的错误信息: [setErrorMap](ERROR_HANDLING.md#customizing-errors-with-zoderrormap) -- **Maps and sets**. Zod 现在支持 [`Map`](#maps) 和 [`Set`](#sets) 模式。 -- **可选的和可忽略的解包**. ZodOptional 和 ZodNullable 现在有一个`.unwrap()`方法来检索它们所包裹的模式。 -- **A new implementation of transformers**. 请参阅[迁移指南](https://github.com/colinhacks/zod/blob/master/MIGRATION.md)部分以了解语法的变化。 +
# 內容 diff --git a/index.html b/index.html index e193b616c..c4e39f011 100644 --- a/index.html +++ b/index.html @@ -36,7 +36,7 @@ + +