I'm trying to convert the Cognito user attributes I get from CognitoIdentityServiceProvider listUsersInGroup to plain object but I didn't found any library or AWS function that does it... then I tried to implement it by myself

That's what I came up with:

```
{
    ...user,
    Attributes: user.Attributes.map((x) => ({ [x.Name]: x.Value })),
}

```

But that makes an array with objects and I'm trying to create an object with all the attributes...

```
[
    {
        "sub": "dasfdasfd-vcfdgfd",
    },
    {
        "website": "aba",
    },
    {
        "address": "new",
    },
]

```

here is an example of the user's data (the attributes can be different from user to user):

user a:

```
[
    {
        "Name": "sub",
        "Value": "dasfdasfd-vcfdgfd",
    },
    {
        "Name": "website",
        "Value": "aba",
    },
    {
        "Name": "address",
        "Value": "new",
    },
    {
        "Name": "email_verified",
        "Value": "false",
    },
    {
        "Name": "phone_number_verified",
        "Value": "false",
    }
]

```

user b:

```
[
    {
        "Name": "custom:age",
        "Value": "0",
    },
    {
        "Name": "custom:height",
        "Value": "0",
    },
    {
        "Name": "email",
        "Value": "dsafdsa@gmail.com",
    }
]

```