Skip to content

Commit 7011121

Browse files
avoid unnecessary re-desctructuring
1 parent da23a0a commit 7011121

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

apps/site/next-data/providers/blogData.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ import { BLOG_POSTS_PER_PAGE } from '@/next.constants.mjs';
44
import { blogData } from '@/next.json.mjs';
55
import type { BlogCategory, BlogPostsRSC } from '@/types';
66

7-
const { categories, posts } = {
8-
...blogData,
9-
posts: blogData.posts.map(post => ({
10-
...post,
11-
date: new Date(post.date),
12-
})),
13-
};
7+
const categories = blogData.categories;
8+
const posts = blogData.posts.map(post => ({
9+
...post,
10+
date: new Date(post.date),
11+
}));
1412

1513
export const provideBlogCategories = cache(() => categories);
1614

0 commit comments

Comments
 (0)