Hi Everyone - just want to get some feedback on ho...
# typescript
a
Hi Everyone - just want to get some feedback on how I'm handling AWS ACM DNS-based certificate validation in Typescript. The docs have this example, which didn't work for me, and seems a bit overly-complicated to me. I'm wondering if there's anything wrong or potentially problematic with my approach? I know it's subjective, but it seems a bit cleaner and reliable to me, but I'm not a Typescript expert, so I'm wondering if I'm overlooking anything. Thanks!
m
Are you mostly looking at the way you are iterating over
dvo.entries()
compared to how it was collected in the example with
.reduce(...).map(...)
? I agree that your code is more readable and I don't see anything that sticks out as wrong to me.
a
Yeah - exactly, mostly the reduce/map call in the example. I wasn't quite clear what that was doing compared to this approach. Thanks for looking it over!
m
Yeah it's quite confusing in the example. Starts with an array of objects, calls
.reduce
to turn it into a map, renaming the properties, calls
Object.entries
on the map to turn it back into an array of tuples, and finally
.map
to turn it back into an array of objects with
key
and
value
properties. In my professional opinion it is doing nothing 🙂
😃 1