Refactor isFulfilled check into a utils function

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
Sebastian Martinez
2022-09-15 12:55:46 +02:00
committed by Alexis Sellier
parent 5cb733e73b
commit 4ebf073c5b
4 changed files with 16 additions and 16 deletions
+2 -4
View File
@@ -6,7 +6,7 @@ import type { TypedDataSigner } from "@ethersproject/abstract-signer";
import * as session from "@app/session";
import { Failure } from "@app/error";
import type { Config } from "@app/config";
import { unixTime } from "@app/utils";
import { isFulfilled, unixTime } from "@app/utils";
import { assert } from "@app/error";
import { Seed, InvalidSeed } from "@app/base/seeds/Seed";
import * as cache from "@app/cache";
@@ -105,9 +105,7 @@ export async function getRegistration(
anchorsAccount,
twitter,
github,
] = meta.map(r =>
r.status === "fulfilled" && r.value ? r.value : undefined,
);
] = meta.filter(isFulfilled).map(r => (r.value ? r.value : undefined));
const profile: EnsProfile = {
name,