1.0.3 • Published 10 months ago

@jswork/is-arrow-fn v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

is-arrow-fn

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

version license size download

installation

npm install @jswork/is-arrow-fn

usage

import isArrowFn from '@jswork/is-arrow-fn';

const obj = {
  fn1() {
    console.log("normal fn1", this);
  },
  fn2: () => {
    console.log("arrow fn2", this);
  },
  fn3: function () {
    console.log("normal fn3", this);
  },
  fn4: function () {
    return () => {
      console.log("123");
    };
  },
};

isArrowFn(obj.fn1); // false
isArrowFn(obj.fn2); // true
isArrowFn(obj.fn3); // false
isArrowFn(obj.fn4); // false

license

Code released under the MIT license.

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago