'Using POJOs in fp-ts

I want to do what I think is the simplest thing, map through a plain old Javascript object, using fp-ts constructs.

There are a lot of operators I would like to use — map, filterMap, and so on — but they seem to require the Map type (which I assume is the Javascript Map object) — and there does not seem to be any easy way to convert back and forth between Map and Javascript object, which in Typescript is the standard representation of algebraic data types and of its Record<K,V> type.

This seems like a pretty big hole. Please don’t tell me I have to switch to lodash...



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source