1.0.4 • Published 5 years ago

node-is-class v1.0.4

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

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