contentlayerdev / contentlayerdev/contentlayer

Provide more utility functions (pick, ...)

Đang mở
#24 3 bình luận 2 reaction 0 người được giao Xem trên GitHub
feature
Ngôn ngữ chính
TypeScript
Star
3.5k
Fork
192
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

There's a number of common utility functions which are useful in Contentlayer projects (e.g. a type-safe `pick` function) like below or [here](https://github.com/leerob/leerob.io/blob/6f4ddbb390ca513dab32ecc75ce6fc8b05b9902b/lib/utils.ts#L1):

image

We should provide these utility functions out of the box with Contentlayer. Candidates:

- `pick`: Type-safe function similar to TS `Pick` type
- A function that helps with getting the "next" and "previous" document (common in docs pages)
- A function that helps with sorting documents
- `findById`

If you'd like to see an other utility function added, please share your requests/ideas in the comments below. 🙏

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.