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
Could you please help me in how to create an optional field while creating io-ts types
for e.g. in below code "contact" type , how to make addressDetails as an optional field like typescript optional field with (?)
export const contact = t.type {
addressDetails: address, // need to make only addressDetails as an optional field
email: email, // need this as required
phone: phone // need this as required
})
The text was updated successfully, but these errors were encountered:
Hi ,
Could you please help me in how to create an optional field while creating io-ts types
for e.g. in below code "contact" type , how to make addressDetails as an optional field like typescript optional field with (?)
import * as t from 'io-ts'
export const address = t.type({
addressline1: t.string,
city: t.string
countryName: t.string
})
export const email = t.type({
emailId: t.string,
})
export const phone= t.type({
number: t.string,
extn: t.string
})
export const contact = t.type {
addressDetails: address, // need to make only addressDetails as an optional field
email: email, // need this as required
phone: phone // need this as required
})
The text was updated successfully, but these errors were encountered: