clean properties of object not in interface typescript code example
Example: typescript cast to type remove properties
type A = { foo: 1, bar: 2 }
type B = { foo: 'asdf' }
type C = Pick<A, keyof B>
type A = { foo: 1, bar: 2 }
type B = { foo: 'asdf' }
type C = Pick<A, keyof B>