I have for example this variable:
let moveReport: MoveReport.Interface[] = []
And I have this check function
export function hasMoveReportParsedDestination(moveReport: Interface): moveReport is Interface & { destination: Pick<LocationI, 'id' | 'name'> } {
return typeof moveReport.destination !== 'string';
}
if I do
moveReport = data.filter((moveReport) => MoveReport.hasMoveReportParsedDestination(moveReport))
How can I let typescript know that moveReport's destination is now of type Pick<LocationI, 'id' | 'name'> and not string anymore?
Because moveReport is still recognized as string |