-2
Is there any possibility of creating an object with only a few attributes of another?
In Adonis, it is possible to filter which exact fields to pick from one request object and already create another in a very nice way.
Ex:
const user_data = request.only(['name', 'email'])
Which is the same thing as doing:
const user_data = { name: request.all().name, email: request.all().email }
using prototype think it is possible
– WPfan
You can use normal JS destruction as long as you know the exact structure of the object and where are the properties you are interested in. This
request
comes from where ? What are the properties you have ?– Isac