- a function need to accept objects
- but couldn't find a way to convert an JS Object to a Reason Record (holds optional value)
// I wanted to have an npm module function like below
reasonFnExposedToJs({key1: 'blah', key2: undefined})
// and works fine with Reason side but generated argsFromJs looks like below
function argsFromJs(param) {
return /* record */[
/* key1 */param.key1,
/* key2 */param.key2,
/* key3 */param.key3
];
}
// which doesn't map possible optional values
// so end up printing only first character of string since option is implemented as [something]
found my answer with https://gist.github.com/ryuheechul/573ea3c203d8fb736ed82480cb8dafbc#file-re-func-re after playing more with reason