Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianHymer committed Dec 30, 2024
1 parent b602c8d commit 2a487be
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions iam/src/utils/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,30 @@ import { providers, platforms } from "@gitcoin/passport-platforms";
import { ApiError } from "./helpers.js";
import { checkCredentialBans } from "./bans.js";

const providerTypePlatformMap = Object.entries(platforms).reduce((acc, [platformName, { providers }]) => {
providers.forEach(({ type }) => {
acc[type] = platformName;
});
const providerTypePlatformMap = Object.entries(platforms).reduce(
(acc, [platformName, { providers }]) => {
providers.forEach(({ type }) => {
acc[type] = platformName;
});

return acc;
}, {} as { [k: string]: string });
return acc;
},
{} as { [k: string]: string }
);

function groupProviderTypesByPlatform(types: string[]): string[][] {
return Object.values(
types.reduce((groupedProviders, type) => {
const platform = providerTypePlatformMap[type] || "generic";
types.reduce(
(groupedProviders, type) => {
const platform = providerTypePlatformMap[type] || "generic";

if (!groupedProviders[platform]) groupedProviders[platform] = [];
groupedProviders[platform].push(type);
if (!groupedProviders[platform]) groupedProviders[platform] = [];
groupedProviders[platform].push(type);

return groupedProviders;
}, {} as { [k: keyof typeof platforms]: string[] })
return groupedProviders;
},
{} as { [k: keyof typeof platforms]: string[] }
)
);
}

Expand Down

0 comments on commit 2a487be

Please sign in to comment.