UNPKG
conversor-texto-noche-yorhs
Version:
latest (1.0.0)
1.0.0
Paquete que transforma un texto
conversor-texto-noche-yorhs
/
index.js
11 lines
(10 loc)
•
290 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
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"
); } }
module
.
exports
= transformarTexto