Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

198
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!