is there a simple solution to the following problem? I want to cast the object B into the object A.
Thank your for your solutions.
export interface A {
a: string;
}
export interface B extends A {
b: string;
}
const b: B = {
a: 'test1',
b: 'test2'
};
console.log(b); //output: {a:'test1', b:'test2'}
console.log(b as A); //output: {a:'test1', b:'test2'}, but i want {a:'test1'}