Easy to use, fast and lightweight library for Node.js.
[!WARNING] This project is under development and is not yet ready for use.
This library is a collection of functions that help you to check the type of a variable in JavaScript and TypeScript.
- [x] isArray
- [x] isArrayBuffer
- [x] isBigInt
- [x] isBlob
- [x] isBoolean
- [x] isBuffer
- [x] isDate
- [x] isEnum
- [x] isError
- [x] isFunction
- [x] isNothing
- [x] isNull
- [x] isNullOrUndefined
- [x] isNumber
- [x] isObject
- [x] isPromise
- [x] isRegExp
- [x] isString
- [x] isSymbol
- [x] isUndefined
- [x] isURL
- [x] isURLSearchParams
- [x] isVoid
- [x] isFalsy
- [x] isNaNumber
- [x] isTruthy
The following tools were used in the construction of the project:
Use the package manager npm, yarn.
npm install @geisonjr/typefy
yarn add @geisonjr/typefy
import { isBoolean } from '@geisonjr/typefy'
let test: any = true // false
// Is `true` if the value is a boolean type
if (isBoolean(test)) {
// The intelisense will be recognize the variable as a boolean
console.log('This is a boolean')
}
// Output: This is a boolean
import { isNumber } from '@geisonjr/typefy'
let test: any = '123'
// Is `true` if the value is a number type
if (isNumber(test)) {
// The intelisense will be recognize the variable as a number
console.log('This is a number')
} else {
// The intelisense will be recognize the variable not as a number
console.log('This is not a number')
}
// Output: This is not a number
This project is under the MIT License