@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

Package Sidebar

Install

npm i @bemoje/is-constructor

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

7.58 kB

Total Files

5

Last publish

Collaborators

  • bemoje