is-function-x
Determine whether a given value is a function object.
Last updated 7 years ago by xotic750 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install is-function-x 
SYNC missed versions from official npm registry.

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

is-function-x

Determine whether a given value is a function object.

module.exports(value, [allowClass])boolean

Checks if value is classified as a Function object.

Kind: Exported function
Returns: boolean - Returns true if value is correctly classified, else false.

Param Type Default Description
value * The value to check.
[allowClass] boolean false Whether to filter ES6 classes.

Example

import isFunction from 'is-function-x';

console.log(isFunction()); // false
console.log(isFunction(Number.MIN_VALUE)); // false
console.log(isFunction('abc')); // false
console.log(isFunction(true)); // false
console.log(isFunction({name: 'abc'})); // false
console.log(isFunction(function() {})); // true
console.log(isFunction(new Function())); // true
console.log(isFunction(function* test1() {})); // true
console.log(isFunction(function test2(a, b) {})); // true
console.log(isFunction(async function test3() {})); // true
console.log(isFunction(class Test {})); // false
console.log(isFunction(class Test {}, true)); // true
console.log(
  isFunction((x, y) => {
    return this;
  }),
); // true

Current Tags

  • 4.1.2                                ...           latest (7 years ago)

49 Versions

  • 4.1.2                                ...           7 years ago
  • 4.1.1                                ...           7 years ago
  • 4.1.0                                ...           7 years ago
  • 4.0.28                                ...           7 years ago
  • 4.0.27                                ...           7 years ago
  • 4.0.26                                ...           7 years ago
  • 4.0.25                                ...           7 years ago
  • 4.0.24                                ...           7 years ago
  • 4.0.23                                ...           7 years ago
  • 4.0.22                                ...           7 years ago
  • 4.0.21                                ...           7 years ago
  • 4.0.20                                ...           7 years ago
  • 4.0.19                                ...           7 years ago
  • 4.0.18                                ...           7 years ago
  • 4.0.17                                ...           7 years ago
  • 4.0.16                                ...           7 years ago
  • 4.0.15                                ...           7 years ago
  • 4.0.14                                ...           7 years ago
  • 4.0.13                                ...           7 years ago
  • 4.0.12                                ...           7 years ago
  • 4.0.11                                ...           7 years ago
  • 4.0.10                                ...           7 years ago
  • 4.0.9                                ...           7 years ago
  • 4.0.8                                ...           7 years ago
  • 4.0.7                                ...           7 years ago
  • 4.0.6                                ...           7 years ago
  • 4.0.5                                ...           7 years ago
  • 4.0.4                                ...           7 years ago
  • 4.0.3                                ...           7 years ago
  • 4.0.2                                ...           7 years ago
  • 4.0.1                                ...           7 years ago
  • 4.0.0                                ...           7 years ago
  • 3.3.0                                ...           8 years ago
  • 3.2.0                                ...           9 years ago
  • 3.1.1                                ...           9 years ago
  • 3.1.0                                ...           9 years ago
  • 3.0.0                                ...           9 years ago
  • 1.4.0                                ...           9 years ago
  • 1.3.0                                ...           9 years ago
  • 1.2.0                                ...           9 years ago
  • 1.1.1                                ...           9 years ago
  • 1.1.0                                ...           9 years ago
  • 1.0.6                                ...           10 years ago
  • 1.0.5                                ...           10 years ago
  • 1.0.4                                ...           10 years ago
  • 1.0.3                                ...           10 years ago
  • 1.0.2                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 3
This Month 13
Last Day 1
Last Week 10
Last Month 20
Dependencies (8)
Dev Dependencies (66)

Copyright 2013 - present © cnpmjs.org | Home |