Skip to content

Commit 7eb9efc

Browse files
committed
chore: updated pattern
1 parent 468aad0 commit 7eb9efc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/toPascalCase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { PascalCase } from './types/strings.js';
55
import type { KeyValueTuple } from './types/tuples.js';
66

77
export function toPascalCase<Type extends string>(text: Type, customWords?: StringRecord): PascalCase<Type> {
8-
const words = String(text).match(/[A-Z][a-z']+|\d+|[a-z']+|[A-Z]+(?![a-z])/g);
8+
const words = String(text).match(/[A-Z](?:[a-z']*[a-z])?|[a-z']+|\d+|[A-Z]+(?![a-z])/g);
99

1010
let fixedWords = words?.map<string>((word) => capitalize(word.replace(/'/g, '')));
1111

0 commit comments

Comments
 (0)