npm module to determine if a function is an ES6 arrow function or not.
NOTE: Only works in Firefox at the moment.
var isArrowFunction = require('is-arrow-function');
assert(!isArrowFunction(function () {}));
assert(!isArrowFunction(null));
assert(isArrowFunction((a, b) => a * b));
assert(isArrowFunction(() => 42));
assert(isArrowFunction(x => x * x));
assert(isArrowFunction(x => () => x * x));
Simply clone the repo, npm install
, and run npm test