Utilities

Utility functions for Payload CMS to handle validation, ID extraction, and document resolution.

Community 0 19/wk MIT v1.1.1

Installation

pnpm add payload-utilities

About

Payload Utilities provides a collection of functions designed specifically to enhance the Payload CMS development experience. It includes utilities for creating type-safe validators, which allow you to combine custom validation logic with default validators. Users can implement complex validation scenarios while maintaining type safety throughout their code. Additionally, the plugin includes functions to extract IDs from various input types. This feature simplifies the process of working with Payload documents that may either be presented as raw IDs or as objects containing IDs. The extractId and extractIds functions streamline this process for developers. The getDocument and getDocuments functions efficiently resolve documents from either full objects or their IDs, providing a callback mechanism to fetch documents from a specified collection. This makes it easy to work with documents in a flexible manner, handling both full documents and references seamlessly.

Package info

Package name
payload-utilities
Latest version
1.1.1
Unpacked size
9 kB
License
MIT
Weekly downloads
19
Last publish
Mar 19, 2026

More from bhofstaetter

View profile