export default (val: V | undefined, def: () => V) => val === undefined ? def() : val;