How do I filter
const data = {
id: 1,
title: "Hello, world!",
body: "This is a test post.",
createdAt: new Date(),
updatedAt: new Date(),
visible: true
};
with schema
const schema = {
id: true,
title: true,
body: true,
createdAt: true,
updatedAt: false,
visible: false
};
and still get full type checking and correct filtered data based on the schema
so end result of the filteredData type is
{
id: string,
title: string,
body: string,
createdAt: Date,
}
(with the visible and UpdatedAt gone)