News for hackers. Stuff that matters.
Re:Zod: TypeScript-first schema validation with static type ... by gkiely on Thursday October 10, 2024 @09:49AM (#41798795)
It does: https://valibot.dev/guides/optionals/#use-in-objects

  import * as v from 'valibot';
  const OptionalKeySchema = v.object({ key: v.optional(v.string()) });
  type t1 = v.InferInput<typeof OptionalKeySchema>; // { key?: string }

  const UndefinedKeySchema = v.object({ key: v.undefinedable(v.string()) });
  type t2 = v.InferInput<typeof UndefinedKeySchema>; // { key: undefined }

There are no comments on this comment yet.