Hey this is super cool! I have two question if you don't mind.
Do you know how to go from a {key1: 1, key2: 2} as const to [['key1', 1], ['key2', 2]] as const. It seems like this is impossible with Object.entries since the types are lost.
Do you know how we could adapt the solution you gave for arbitrarily nested arrays. For example
[['key1', 1], ['key2', ['key2_1',2.1]]] as const
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey this is super cool! I have two question if you don't mind.
{key1: 1, key2: 2} as const
to[['key1', 1], ['key2', 2]] as const
. It seems like this is impossible with Object.entries since the types are lost.[['key1', 1], ['key2', ['key2_1',2.1]]] as const