Replies: 2 comments 1 reply
-
Isn't const Schema1 = object({ foo: number(), bar: number() });
const Schema2 = partial(object({ foo: number(), bar: number() })); |
Beta Was this translation helpful? Give feedback.
0 replies
-
In my codebase I have objects with hundreds of keys, but they are constant. I'd rather not have to define each and every one of them in the schema. export const SOURCE = {
SITE1: {
name: "Site 1",
url: "https://www.site1.com",
network: "Network 1"
},
SITE2: {
name: "Site 2",
url: "https://www.site2.com",
network: "Network 1"
},
SITE3: {
name: "Site 3",
url: "https://www.site3.com",
network: "Network 2"
},
SITE4: {
name: "Site 4",
url: "https://www.site4.com",
network: "Network 2"
},
...
} as const |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Something like
Or something like
Beta Was this translation helpful? Give feedback.
All reactions