feat: ability to add and view blogs for a user

This commit is contained in:
2025-06-24 18:54:48 -04:00
parent 07c0977aa7
commit 7da38ddd8c
26 changed files with 1553 additions and 142 deletions
+9
View File
@@ -0,0 +1,9 @@
export function countWords(text: string): number {
// Trim leading/trailing whitespace, then split on one-or-more whitespace characters
const words = text.trim().split(/\s+/);
// If the string was empty or only whitespace, split() returns [''], so handle that
if (words.length === 1 && words[0] === "") {
return 0;
}
return words.length;
}