Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

176
Visualizações
[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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda