is-arrow-function

Determine if a function is an ES6 arrow function or not.

MIT 7 个版本
安装
npm install is-arrow-function
yarn add is-arrow-function
pnpm add is-arrow-function
bun add is-arrow-function
README

#is-arrow-function Version Badge

Build Status dependency status dev dependency status

npm badge

browser support

npm module to determine if a function is an ES6 arrow function or not.

NOTE: Only works in Firefox at the moment.

Example

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));

Tests

Simply clone the repo, npm install, and run npm test

版本列表
2.0.3 2015-08-16
2.0.2 2015-01-29
2.0.1 2014-12-15
2.0.0 2014-12-03
1.0.2 2014-08-10
1.0.1 2013-12-07
1.0.0 2013-09-13