You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Generated by ts-to-zodimport{z}from'zod'import{COL}from'src/col'exportconstcolSchema=z.nativeEnum(COL)exportconstcarSchema=z.object({})
Desired Output
// Generated by ts-to-zodimport{z}from'zod'import{COL}from'src/col'exportconstcolSchema=z.nativeEnum(COL)exportconstcarSchema=z.object({[COL.MODEL]: z.string(),})
The text was updated successfully, but these errors were encountered:
harlos0517
changed the title
Feature Request: support computed property (such as enum value) as object key
Feature Request: support computed property (such as enum value) as property key
Oct 18, 2023
Feature description
If the key of a property is not a literal, original behavior is it will be ignored.
It would be nice to support computed property key (such as constants and enum values)
I did found a quick way to work by modifying the source code:
But there might be edge cases I haven't thought of.
Input
Original Output
Desired Output
The text was updated successfully, but these errors were encountered: