Code below throws Spread types may only be created from object types:
const bool = true
console.log({ ...(bool || { foo: 'bar' }) })
While the following works fine, what caused the above error and how to suppress it?
const bool = true
console.log({ ...(bool && { foo: 'bar' }) })