@bemoje/is-constructor

1.1.1 • Public • Published

@bemoje/is-constructor

Returns true if 'value' is a constructor

Version

NPM version

Travis CI

dependencies

Dependencies

dependencies

Stats

NPM downloads Forks

Donate

Buy Me A Beer donate button PayPal donate button

Installation

npm install @bemoje/is-constructor
npm install --save @bemoje/is-constructor
npm install --save-dev @bemoje/is-constructor

Usage

import isConstructor from '@bemoje/is-constructor'

isConstructor(class {})
//=> true

isConstructor(function () {})
//=> true

isConstructor(() => {})
//=> false

isConstructor(/s/)
//=> false

isConstructor(void 0)
//=> false

isConstructor(null)
//=> false

isConstructor('asd')
//=> false

isConstructor(2)
//=> false

Tests

Uses Jest to test module functionality. Run tests to get coverage details.

npm run test

API

isConstructor

Returns

true if 'value' is a constructor

Parameters
  • constructor any The value to evaluate
Returns

boolean

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.1
    5
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.1
    5
  • 1.1.0
    3
  • 1.0.0
    2

Package Sidebar

Install

npm i @bemoje/is-constructor

Weekly Downloads

3

Version

1.1.1

License

MIT

Unpacked Size

7.58 kB

Total Files

5

Last publish

Collaborators

  • bemoje