Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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 }


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: