Вот этот код.
function inspect(item: { label: string } | {}) {
if (item.label) { //error
console.log("inspect jingo");
}
}
Получаю такую ошибку: The property "label" does not exist in the type "{} | {label: string;}".The property "label" does not exist in the type "{}".
Я новичок в typescript. Как объявить, что item принимает пустой объект либо {label: string}.