First public commit

This commit is contained in:
Luke Vella 2022-04-12 07:14:28 +01:00
commit e05cd62e53
228 changed files with 17717 additions and 0 deletions

8
utils/prevent-widows.ts Normal file
View file

@ -0,0 +1,8 @@
export const preventWidows = (text: string) => {
// This only really makes sense if we have at least 3 words
if (text.split(" ").length < 3) {
return text;
}
const index = text.lastIndexOf(" ");
return [text.substring(0, index), text.substring(index + 1)].join("\u00a0");
};