Skip to content

Commit daa0bfd

Browse files
feat: fill in flavorful zod-lite description
1 parent 2010ab3 commit daa0bfd

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

dictionary.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ irvienigssa
110110
justo
111111
kimi
112112
krusty
113+
Kryptonian
113114
labore
114115
lacinia
115116
lacus

projects/type-operations/zod-lite/README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
55
Kneel before Zod!
66

7+
General Zod of the Kryptonian Army demands your assistance in creating a [Zod](https://zod.dev)-like schema validation library.
8+
It must support strings, literal strings, unions of literal strings, and objects with properties that can be any of the above.
9+
Only in this way will the former glory of the Kryptonian Army be restored.
10+
711
## Setup
812

913
In one terminal, run the TypeScript compiler via the `tsc` script.
@@ -33,26 +37,26 @@ Additionally, export an `type Infer<Schema>` that creates a TypeScript type for
3337

3438
## Example
3539

36-
This code:
40+
Given this code:
3741

3842
```ts
3943
import * as z from "./index";
4044

4145
const spySchema = z.object({
4246
disguise: z.string(),
43-
moniker: z.literal("007"),
44-
plan: z.union([z.literal("active"), z.literal("improvising")]),
47+
trueName: z.literal("Kal-El"),
48+
role: z.union([z.literal("hero"), z.literal("reporter")]),
4549
});
4650

4751
type Spy = z.Infer<typeof spySchema>;
4852
```
4953

50-
...create a `Spy` type equivalent to:
54+
The `Spy` type should be equivalent to:
5155

5256
```ts
5357
type Spy = {
5458
disguise: string;
55-
moniker: "007";
56-
plan: "active" | "improvising";
59+
trueName: "Kal-El";
60+
role: "hero" | "reporter";
5761
};
5862
```

0 commit comments

Comments
 (0)