How can I get expected result and what's the best approach to limit property when type casting ??
interface user {
name: string
password: string
}
interface userEntity {
name: string
}
const user: user = {
name: 'name',
password: 'password'
}
const result = user as userEntity;
// output { name: 'name', password: 'password' }
// expected { name: 'name' }