contentlayerdev / contentlayerdev/contentlayer

Provide more utility functions (pick, ...)

Ouverte
#24 3 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
feature
Langage dominant
TypeScript
Étoiles
3.5k
Forks
192
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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. 🙏

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.