aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/helpers
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-01-04 13:35:25 +0100
committerArmand Philippot <git@armandphilippot.com>2022-01-04 13:35:25 +0100
commitd53d375d09dd86a85ffb249de1c0cc7c3b3438bc (patch)
tree827e02f739a542e674e5d447f46ee97096f02cd7 /src/utils/helpers
parentab5e5f4bdf40b5bc1ccf82dc1b4aca94d5171ec3 (diff)
refactor: avoid useless assignement before return statement
Diffstat (limited to 'src/utils/helpers')
-rw-r--r--src/utils/helpers/format.ts8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/utils/helpers/format.ts b/src/utils/helpers/format.ts
index 94aa2e7..44536dd 100644
--- a/src/utils/helpers/format.ts
+++ b/src/utils/helpers/format.ts
@@ -61,15 +61,11 @@ export const getFormattedPostPreview = (rawPost: RawArticlePreview) => {
export const getFormattedPostsList = (
rawPosts: RawArticlePreview[]
): ArticlePreview[] => {
- const formattedPosts = rawPosts
+ return rawPosts
.filter((post) => Object.getOwnPropertyNames(post).length > 0)
.map((post) => {
- const formattedPost = getFormattedPostPreview(post);
-
- return formattedPost;
+ return getFormattedPostPreview(post);
});
-
- return formattedPosts;
};
/**