Arrow functions aren't supported
roman-koshchei opened this issue · 3 comments
roman-koshchei commented
kungfooman commented
First of all, mixing JavaScript with type comments ("TypeScript") is ugly and you are better off writing JSDoc:
/**
* @callback Where
* @param {Over} over
* @returns {A}
*/
/**
* @param {Where} condition - TODO: Explain what this is...
*/
function where(condition) {
const o = new Over();
const overloadedFunction = overload(condition);
return overloadedFunction(o, condition);
}
const data = where(p => p.a1 || p.a2);
Secondly, esprima@1
doesn't support ES6, you need to install esprima@2
:
npm i esprima@2
Then it should work...