is-arrow-function
Determine if a function is an ES6 arrow function or not.
Last updated 11 years ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install is-arrow-function 
SYNC missed versions from official npm registry.

#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

Current Tags

  • 2.0.3                                ...           latest (11 years ago)

7 Versions

  • 2.0.3                                ...           11 years ago
  • 2.0.2                                ...           12 years ago
  • 2.0.1                                ...           12 years ago
  • 2.0.0                                ...           12 years ago
  • 1.0.2 [deprecated]           ...           12 years ago
  • 1.0.1 [deprecated]           ...           13 years ago
  • 1.0.0 [deprecated]           ...           13 years ago
Maintainers (1)
Downloads
Total 19
Today 0
This Week 0
This Month 8
Last Day 0
Last Week 0
Last Month 10
Dependencies (1)
Dev Dependencies (7)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE