코드는 이렇습니다.
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}을 받도록 어떻게 선언하나요.