Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

175
Vistas
[Performing issue]Map over an variable and change its value in typescript

Edit: I' ve found a similar question and resolved this with this code:

testeTipoMySQLtoOracle(testeTipo: any) {

    var tipoNumber = {
        "aceitacao": 1,
        "integracao": 4,
        "interface-mobile": 5,
        "interface-web": 6,
        "performance": 7,      
        "unitario": 8,
    };
    var indice: keyof typeof tipoNumber = testeTipo; 

    if (indice in tipoNumber) {
        return tipoNumber[indice];
    }
}

I Want to receive a value and change it before sending a request to my DataBase. One DataBase send me a string and I must assign its equivalent number before sending it to the other DataBase.

Here is what I have so far:

testeTipoMySQL(testeTipo: string){
        if(testeTipo == "aceitacao"){
            return 1;
        }else if(testeTipo == "integracao"){
            return 4;
        }else if(testeTipo == "interface-mobile"){
            return 5;
        }else if(testeTipo == "interface-web"){
            return 6;
        }else if(testeTipo == "performance"){
            return 7;
        }else if(testeTipo == "unitario"){
            return 8;
        }
    } 

I want to know if is there another better way of doing it that I'm not seeing cause I'm new to JavasCript.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda