A partial input and a complete configuration serve different callers. Fill required values at one boundary so downstream code can rely on them.
Worked example
type Settings = { theme: string; limit: number; debug: boolean };
const settings: Settings = { theme: "dark", limit: 4, debug: false };
console.log(((v: Required<Partial<Settings>>) => v.debug)(settings));Result
falseImplementation notes
Spreading an input object after defaults can overwrite a default with explicit undefined. Define what an explicitly missing value should mean.
Try it yourself
Omit each optional input in turn and inspect the resolved settings.
Open the TypeScript example →Editorial date June 7, 2026 · Published December 6, 2026