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

196
Vistas
js/ts translate internal commands

I am currently trying to translate some text-based console-log processing into JSON format.

Console.log commands:

give ENTITY.name = "entitytest";
give entity.userid = 99;
give entity.storagenum = 22;
give ENTITY.behaviour = "GIVE entity.storagenum xp to USERID" WHEN entity2.quest = 22

The console input will be processed:

var translatedData = "READ FROM STRING";

result in this kind of translation:

 {
    'entity.name' = "entitytest",
    entity.behaviour: {data: "give entity.storagenum xp to USERID", result: "give 22  xp to 99 when entity2 quest is 22", 
     when: ["entity2.quest": 22}],

}

Thoughts:

  • How will I create this class to build it upon?
  • How can I do the nesting, with multiple behaviours and reasons behind the entity behaviour? How would I be able to build this kind of functionality? I have been trying with javascript, but typescript answers also work.
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