z.omit() removes type information

Hmmm, I couldn't quickly find a way to do that, but I assume it's possible. FWIW, I think I would approach this slightly differently by defining a const mask and using omit directly.
const CREATE_MASK = {
someProperty: true
} as const;
schema.omit(CREATE_MASK);
const CREATE_MASK = {
someProperty: true
} as const;
schema.omit(CREATE_MASK);
Or something like that.
3 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Scott Trinh
Scott TrinhOP2y ago
No, I just mean instead of having a function, just use the mask directly to get a new schema:
const fooSchema = testSchema.omit(CREATE_MASK);
const fooSchema = testSchema.omit(CREATE_MASK);
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server