i have this interface
interface Product {
id: string
name: string
}
and the one that extends it
interface AdminProduct extends Product {
isVisible: boolean
}
then i have this code
const adminProducts = (await queryByCollection('product')) as AdminProduct[]
const products = adminProducts.filter((product) => {
if (!product.isVisible) {
return
}
}).map((product)=> product as Product) as Product[]
return products
even though i define the return type of product when i map adminProducts array it still has the key 'isVisible' in it
how to convert an object to smaller interface and delete all redundant keys?