Recommended way to extract out schema of a prop #681
-
If I have an object schema is doing |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Also a related question 👀 So I would need to remap the basic schema so that each field not has a fallback schema. const entries = Object.entries(schema.entries.prop);
const remappedEntries = entries.map(([key, schema])=>[key, v.fallback(schema, getFallback(key))]);
const fallbackSchema = Object.fromEntries(remappedEntries); is this the way? |
Beta Was this translation helpful? Give feedback.
-
Yes, |
Beta Was this translation helpful? Give feedback.
Yes,
schema.entries.prop
is the recommended way.