code-mantras
Version:
Lightweight npm package delivering 100+ powerful, tech-focused motivational greetings to boost productivity for developers, and teams.
16 lines (13 loc) • 460 B
JavaScript
import { inspirationalGreetings } from "./greetings.js";
export const getRandomGreeting = () => {
const keys = Object.keys(inspirationalGreetings);
const randomKey = keys[Math.floor(Math.random() * keys.length)];
return inspirationalGreetings[randomKey];
};
export const capitalizeName = (name) => {
if (!name) return "";
return name
.split(" ")
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
.join(" ");
};