-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: update README_KO #4025
base: main
Are you sure you want to change the base?
docs: update README_KO #4025
Conversation
WalkthroughThe changes update the type inference declarations in the Changes
Sequence Diagram(s)Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for guileless-rolypoly-866f8a ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
README_KO.md (2)
1224-1224
: Consistent Inference on Object with Optional FieldThe change in
type C = z.infer<typeof user>;
clearly demonstrates how to extract the type from an object schema where a property is made optional. For improved clarity, you might consider renaming the inferred type (for example, toUserType
), but as a documentation example this is acceptable.
1789-1789
: Note on Intersection Type InferenceThe change
type c = z.infer<typeof c>;
correctly infers the type (which, in this case, results in anumber
). One suggestion: since using the same identifier for both the variable and the inferred type (here "c") might be confusing, consider using a more descriptive name (for example,type IntersectionResult = z.infer<typeof c>;
) in future documentation updates.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
README_KO.md
(30 hunks)
🔇 Additional comments (12)
README_KO.md (12)
652-652
: Explicit Type Inference for User SchemaThe update from an implicit
z.infer
to an explicitz.infer<typeof User>
clarifies that the inferred type is directly tied to theUser
schema. This change meets the PR objective for enhanced clarity and type safety in documentation.
1068-1068
: Explicit Type Inference for Date SchemaChanging the date schema’s type declaration to
type DateSchema = z.infer<typeof dateSchema>;
ensures that the inferred type is explicitly linked todateSchema
. This improves the example’s clarity and aligns with the documentation update goals.
1088-1088
: Clarifying Inference for FishEnumUpdating the fish enum definition to
type FishEnum = z.infer<typeof FishEnum>;
makes the example explicit about the connection between the inferred type and its corresponding schema. This is consistent with the updated documentation standards.
1152-1152
: Precise Inference for Native Enum (FruitEnum)The modification to
type FruitEnum = z.infer<typeof FruitEnum>;
provides an explicit link between the native enum schema and its inferred TypeScript type. This clear pattern enhances readability and correctness in the docs.
1215-1215
: Explicit Inference for Optional Schema ExampleDefining
type A = z.infer<typeof schema>;
after declaring an optional string schema exactly shows that the inferred type includesundefined
(i.e.string | undefined
). This explicitness is very helpful in documentation.
1270-1270
: Inference of Object Schema (Dog)By updating the extraction to
type Dog = z.infer<typeof Dog>;
the example follows the established pattern. This explicit extraction reinforces how to derive the type from the schema, which is especially useful for new users.
1320-1320
: Explicit Inference in Merged Object Schema (Teacher)The updated declaration
type Teacher = z.infer<typeof Teacher>;
after merging object schemas clearly shows how the final inferred type includes properties from both merged schemas. This pattern is both informative and consistent.
1341-1341
: Inference After Picking Object PropertiesChanging the type extraction to
type JustTheName = z.infer<typeof JustTheName>;
demonstrates the proper extraction from a schema created by the.pick()
method. This enhances readability and consistency throughout the docs.
1350-1350
: Explicit Inference for Omitted Schema (NoIDRecipe)The revised declaration
type NoIDRecipe = z.infer<typeof NoIDRecipe>;
shows how to correctly infer the type from a schema that omits certain properties. This is a clear and useful update.
1601-1601
: Clear Tuple Type Inference (Athlete)By explicitly writing
type Athlete = z.infer<typeof athleteSchema>;
the example now clearly shows how to extract the tuple type from the schema. This explicit approach greatly enhances clarity in documentation.
1740-1740
: Explicit Inference for Map SchemaUpdating the map schema type to
type StringNumberMap = z.infer<typeof stringNumberMap>;
explicitly communicates that the inferred type is aMap<string, number>
. This change is aligned with the new documentation guidelines.
1750-1750
: Clear Inference for Set SchemaChanging to
type NumberSet = z.infer<typeof numberSet>;
makes it explicit that the inferred type is aSet<number>
. This clear example enhances developer understanding.
Replaced implicit/incorrect type with explicit Zod inference in README_KO
Summary by CodeRabbit