Skip to content

Commit 2da70de

Browse files
committed
chore: build
1 parent baae8b6 commit 2da70de

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

dist/utils.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// [À-ÖØ-ß]
44
// lower case ranges
55
// [à-öø-ÿ]
6-
export const magicSplit = /^[a-zà-öø-ÿ]+|[A-ZÀ-ÖØ-ß][a-zà-öø-ÿ]+|[a-zà-öø-ÿ]+|[0-9]+|[A-ZÀ-ÖØ-ß]+(?![a-zà-öø-ÿ])/g;
6+
export const magicSplit = /^[a-zà-öø-ÿа-я]+|[A-ZÀ-ÖØ-ßА-Я][a-zà-öø-ÿа-я]+|[a-zà-öø-ÿа-я]+|[0-9]+|[A-ZÀ-ÖØ-ßА-Я]+(?![a-zà-öø-ÿа-я])/g;
77
export const spaceSplit = /\S+/g;
88
/**
99
* A string.matchAll function that will return an array of "string parts" and the indexes at which it split each part
@@ -45,7 +45,9 @@ export function splitAndPrefix(string, options) {
4545
let part = _part;
4646
if (keepSpecialCharacters === false) {
4747
if (keep) {
48-
part = part.normalize('NFD').replace(new RegExp(`[^a-zA-ZØßø0-9${keep.join('')}]`, 'g'), '');
48+
part = part
49+
.normalize('NFD')
50+
.replace(new RegExp(`[^a-zA-ZØßø0-9${keep.join('')}]`, 'g'), '');
4951
}
5052
if (!keep) {
5153
part = part.normalize('NFD').replace(/[^a-zA-ZØßø0-9]/g, '');
@@ -83,5 +85,6 @@ export function splitAndPrefix(string, options) {
8385
export function capitaliseWord(string) {
8486
const match = string.matchAll(magicSplit).next().value;
8587
const firstLetterIndex = match ? match.index : 0;
86-
return string.slice(0, firstLetterIndex + 1).toUpperCase() + string.slice(firstLetterIndex + 1).toLowerCase();
88+
return (string.slice(0, firstLetterIndex + 1).toUpperCase() +
89+
string.slice(firstLetterIndex + 1).toLowerCase());
8790
}

0 commit comments

Comments
 (0)