5

If i have an object in typescript

const x = {a:1, b:2}

And an interfacce

interface MyInterface { a: number }

It possibile to do something like (pseudocode) this

const y = Mapper<MyInterface>(x)

console.log(y)  // {a: 1}

And the result should be the object with the properties defined in the target interface

Something like mapstruct https://mapstruct.org/ in java

0

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.