-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix branded Record keys in ZodRecord
Because of a quirk of the extends syntax of typescript conditional types, the previous version of this check for a branded key didn't work as expected. Thank you @akomm for the explanation of why the extends sides need to be swapped at #2287 (comment) Originally I intended to remove the RecordType type entirely, since it would seem initially that it is only there to work around earlier versions of typescript not having the `noUncheckedIndexedAccess` option. However, it is really meant to work around a problem with using ZodEnum as the key, see this comment: #2287 (comment)
- Loading branch information
Showing
3 changed files
with
5 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters