2.0.0 • Published 3 years ago
@supercharge/classes v2.0.0
Introduction
The @supercharge/classes package provides a handful methods around classes in Node.js and JavaScript. For example, determine whether a given input is a class using the .isClass(input) method.
Installation
npm i @supercharge/classesUsage
Using @supercharge/classes is pretty straightforward. Install and import the package and use it right away:
const { isClass } = require('@supercharge/classes')
isClass(class Rabbit {})
// true
isClass(function classLikeRabbitFunc () {})
// falseAPI
isClass(input)
Determine whether the given input is a class.
const { isClass } = require('@supercharge/classes')
isClass(class YourClass {})
// trueisFunction(input)
Determine whether the given input is a function.
const { isFunction } = require('@supercharge/classes')
isFunction(function sum () {})
// trueContributing
Do you miss a class-related function? We very much appreciate your contribution! Please send in a pull request 😊
- Create a fork
- Create your feature branch:
git checkout -b my-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request 🚀
License
MIT © Supercharge
superchargejs.com · GitHub @supercharge · Twitter @superchargejs