In order to simulate a response from the server, I would like to use keys such as 1.0.0
instead of default indexes. This will result in something like the example below:
https://i.sstatic.net/JUzjf.png
I attempted using
{ 'versions': [ '1.0': { 'name': 'file-system' } ] }
However, this did not work. I also tried:
{ 'versions': [ 1.0: { 'name': 'file-system' } ] }
with the same outcome.
I am aware that there is a more manual way of achieving this.
let dummyResponse = {};
(dummyResponse as any).versions = {};
(dummyResponse as any).versions['1.0'] = { 'name': 'val'};
(dummyResponse as any).versions['1.5'] = { 'name': 'val1'};
(dummyResponse as any).versions['2.0'] = { 'name': 'val2'};
Thank you