#Typescript Conditional Types Confusion

4 messages · Page 1 of 1 (latest)

twilit bear
#
GitHub

Contribute to oshox/schema-function-test development by creating an account on GitHub.

steep mortarBOT
#

@twilit bear Here's a shortened URL of your playground link! You can remove the full link from your message.

oshox#0

Preview:ts const schemas = { foo: { date1: { display: "date", type: "date", }, text1: { display: "text", type: "text", }, number1: { display: "number", type: "number", }, }, bar: { date2: { display: "date", ...

scenic brook
#

You can use a distributive conditional type:

steep mortarBOT
#
angryzor#0

Preview:ts const schemas = { foo: { date1: { display: "date", type: "date", }, text1: { display: "text", type: "text", }, number1: { display: "number", type: "number", }, }, bar: { date2: { display: "date", ...