sat
sat copied to clipboard
Numeric results in JS are ignored
The return value of JavaScript modules returning type Number
values is ignored, the result becomes ""
:
export const run = (input) => {
return 12345
};
// returns a { "result": "" }
export const run = (input) => {
return String(12345)
};
// returns a { "result": "12345" }
According to @ospencer:
TypeScript would force you to return a string/object, but nothing forces that in JS. The Reactr API requires a string be return; the wrapper code will handle strings fine and will call JSON.stringify on objects.