Currently, I find myself in a perplexing predicament where I am required to construct an object with unspecified properties that must maintain the order of insertion. This necessity arises from the fact that I need to transmit this object to a server over which I have no jurisdiction. For illustration:
{
"sfwd-lessons": {
"256": {
"sfwd-topic": {
"270": {
"sfwd-quiz": []
}
},
"sfwd-quiz": {
"289": []
}
},
"255": {
"sfwd-topic": [],
"sfwd-quiz": []
}
},
"sfwd-quiz": []
}
Due to the automatic sorting of properties within objects, I encounter a challenge where the entries "256" and "255" interchange positions when attempting to send the object. Despite my endeavors using various methods such as:
- Record<string,any> //originally utilized for object creation
- Map //when integrated into an object, it became void
- Developing custom type //yielded identical outcome as Record<string,any>
I am currently at a loss for a viable solution.