UNPKG
coversor-texto-noche-reyner
Version:
latest (1.0.0)
1.0.0
Paquete que transforma un texto a mayusculas o minusculas.
coversor-texto-noche-reyner
/
index.js
14 lines
(11 loc)
•
342 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function
transformarTexto
(
texto, tipo
){
if
(tipo ===
'mayusculas'
){
return
texto.
toUpperCase
(); }
else
if
(tipo ===
'minusculas'
){
return
texto.
toLowerCase
(); }
else
{
throw
new
Error
(
'Tipo no valido.'
); } }
//Entrada a la programacion modular
module
.
exports
= transformarTexto;