UNPKG

mr-case

Version:

55 functions to seamlessly transform strings, arrays, and object keys between different cases (camelCase, snake_case, kebab-case, PascalCase, Title Case, and more), clean and format text, extract URL components, and perform common text operations like mas

9 lines (7 loc) 244 B
function initials(name) { if (typeof name !== 'string') throw new Error('Input must be a string'); return name.split(' ') .map(word => word.charAt(0).toUpperCase() + '.') .join(''); } module.exports = initials;