我正在尝试将Record转换为vanilla JS对象
module MyModule where
data Author = Author { name :: String, interests :: Array String }
phil :: Author
phil = Author { name: "Phil", interests: ["Functional Programming", "JavaScript"] }
从JS访问对象时
MyModule.phil
它包含我不感兴趣的其他属性(value0
)
{"value0":{"name":"Phil","interests":["Functional Programming","JavaScript"]}}
如何将Purescript世界的记录编组到JS?