node-is-class

1.0.4 • Public • Published

npm npm npm GitHub license

node-is-class

Check if function is an ES6 class

Does not use toString, use Reflect.ownKeys to check it

Function.prototype.toString does not work with Proxy well

Install

$ npm install --save node-is-class

Usage

const isClass = require('node-is-class')
 
console.log(isClass(class {}))
console.log(isClass(function() {}))
 

Test

$ npm test

License

MIT

Package Sidebar

Install

npm i node-is-class

Weekly Downloads

32

Version

1.0.4

License

MIT

Unpacked Size

9.22 kB

Total Files

6

Last publish

Collaborators

  • zewail