Commit 39bead7
authored
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.1 parent 61a7095 commit 39bead7
1 file changed
+4
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | 1 | | |
| 2 | + | |
7 | 3 | | |
8 | 4 | | |
9 | 5 | | |
| |||
14 | 10 | | |
15 | 11 | | |
16 | 12 | | |
17 | | - | |
| 13 | + | |
18 | 14 | | |
19 | 15 | | |
20 | 16 | | |
| |||
758 | 754 | | |
759 | 755 | | |
760 | 756 | | |
761 | | - | |
| 757 | + | |
762 | 758 | | |
763 | 759 | | |
764 | 760 | | |
| |||
1067 | 1063 | | |
1068 | 1064 | | |
1069 | 1065 | | |
1070 | | - | |
| 1066 | + | |
1071 | 1067 | | |
1072 | 1068 | | |
1073 | 1069 | | |
| |||
0 commit comments