fix: keep 's and ’s lowercase in humanizeKey

This commit is contained in:
ShivaniKhaire 2026-11-02 16:20:24 +05:30
parent 203fbbc0c9
commit b49ae9f047
1 changed files with 2 additions and 1 deletions

View File

@ -41,5 +41,6 @@ export function asRecordArray(value: unknown): Record<string, unknown>[] {
export function humanizeKey(value: string): string {
return value
.replace(/[_-]/g, " ")
.replace(/\b\w/g, (letter) => letter.toUpperCase());
.replace(/\b\w/g, (letter) => letter.toUpperCase())
.replace(/(['’‘ʼ])s\b/gi, (match) => match[0] + "s");
}