Skip to content

Commit

Permalink
chore: build
Browse files Browse the repository at this point in the history
  • Loading branch information
mesqueeb committed May 24, 2023
1 parent 6fa8f8e commit 25fb6ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/cjs/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ function splitAndPrefix(string, options) {
}).filter(Boolean);
}
function capitaliseWord(string) {
const i = string.matchAll(magicSplit).next().value;
const firstLetterIndex = typeof i === "number" ? i : 0;
const match = string.matchAll(magicSplit).next().value;
const firstLetterIndex = match ? match.index : 0;
return string.slice(0, firstLetterIndex + 1).toUpperCase() + string.slice(firstLetterIndex + 1).toLowerCase();
}

Expand Down
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ function splitAndPrefix(string, options) {
}).filter(Boolean);
}
function capitaliseWord(string) {
const i = string.matchAll(magicSplit).next().value;
const firstLetterIndex = typeof i === "number" ? i : 0;
const match = string.matchAll(magicSplit).next().value;
const firstLetterIndex = match ? match.index : 0;
return string.slice(0, firstLetterIndex + 1).toUpperCase() + string.slice(firstLetterIndex + 1).toLowerCase();
}

Expand Down

0 comments on commit 25fb6ae

Please sign in to comment.