Hello, I am currently working on managing responses from a Firebase REST service as outlined in https://firebase.google.com/docs/database/rest/retrieve-data. Below is an example of the response I am getting:
{
"2": {
"name": "John",
"surname": "Cena"
},
"12": {
"name": "Murphy",
"surname": "R ichard"
},
.
.
.
"8": {
"name": "Alisha",
"surname": "Johnson"
}
}
Essentially, the response consists of random keys and employee details:
interface Employee{
private name:string;
private surname:string;
}
The number of elements in the response can vary. I am looking to handle this in TypeScript. The response comes back as an Object and not even an array or map.
I aim to extract an array of Employees
. Any suggestions on how to approach this would be greatly appreciated.