https://github.com/geisonjr/teste
https://github.com/geisonjr/teste
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/geisonjr/teste
- Owner: GeisonJr
- License: mit
- Created: 2024-03-03T23:49:36.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-03T23:53:34.000Z (about 2 years ago)
- Last Synced: 2025-03-11T11:17:03.255Z (12 months ago)
- Language: TypeScript
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Type Checker
> [!WARNING]
> This project is under development and is not yet ready for use.
## 🌱 Overview
This library is a collection of functions that help you to check the type of a variable in JavaScript and TypeScript.
## ✨ Features
- [x] isArray
- [x] isArrayBuffer
- [x] isBigInt
- [x] isBlob
- [x] isBoolean
- [x] isBuffer
- [x] isDate
- [x] isEnum
- [x] isError
- [x] isFalsy
- [x] isFunction
- [x] isNaNumber
- [x] isNothing
- [x] isNull
- [x] isNullOrUndefined
- [x] isNumber
- [x] isObject
- [x] isPromise
- [x] isRegExp
- [x] isString
- [x] isSymbol
- [x] isTruthy
- [x] isUndefined
- [x] isURL
- [x] isURLSearchParams
- [x] isVoid
## 🚀 Tecnologies
The following tools were used in the construction of the project:
- [Jest](https://jestjs.io/)
- [Node.js](https://nodejs.org/en/)
- [TypeScript](https://www.typescriptlang.org/)
## 📦 Install
Use the package manager [npm](https://docs.npmjs.com/),
[yarn](https://yarnpkg.com).
```bash
npm install @geisonjr/type-checker
```
```bash
yarn add @geisonjr/type-checker
```
## 🏗️ Usage
### Example with True Condition
```typescript
import '@geisonjr/type-checker'
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
```
### Example with False Condition
```typescript
import '@geisonjr/type-checker'
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
```
## 📋 License
This project is under the
[MIT License](https://github.com/geisonjr/type-checker/blob/master/LICENSE)