npm's personal messenger
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    is-arrow-functionpublic

    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

    install

    npm i is-arrow-function

    Downloadsweekly downloads

    79,358

    version

    2.0.3

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar