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

10 lines (7 loc) 310 B
function snakeToText(str) { if (typeof str !== 'string' || !str.trim()) throw new Error('Input must be a non-empty string'); return str .replace(/_/g, ' ') .replace(/\b\w/g, char => char.toUpperCase()); // Capitalize first letter of each word } module.exports = snakeToText;