SIGN IN SIGN UP
payloadcms / payload UNCLAIMED

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.

0 0 282 TypeScript

refactor: use formatNames utility for interface name generation (#14481)

## Changes

This PR consolidates the inline interface name generation logic in
`configToJSONSchema.ts` to use the existing `formatNames()` utility
function.

## Motivation

The inline code `singular(toWords(slug, true))` was duplicating logic
already available through `formatNames(slug).singular`. Using the
existing utility function:
- Reduces code duplication
- Maintains consistency with the rest of the codebase
- Makes it clear where the interface naming logic lives

## Testing

Verified that `formatNames(slug).singular` produces identical results to
the previous inline implementation across various slug patterns (plural,
singular, edge cases like 'media', 'series', etc.).

**No behavioral changes** - this generates the exact same interface
names for all collection and global slugs.
T
Tobias Odendahl committed
39bead7e4c6c05644ad9987a6224fb8de34928de
Parent: 61a7095
Committed by GitHub <noreply@github.com> on 11/5/2025, 9:58:37 AM