UNPKG

conversor-texto-nomada

Version:

Paquete para transformar texto en mayúsculas o minúsculas.

12 lines (10 loc) 321 B
function transformarTexto(texto, tipo) { if (tipo === 'mayusculas') { return texto.toUpperCase(); } else if (tipo === 'minusculas') { return texto.toLowerCase(); } else { throw new Error("Tipo no válido. Usa 'mayusculas' o 'minusculas'."); } } module.exports = transformarTexto;