GeisonJr / teste

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logo

Type Checker

Easy to use, fast and lightweight library for Node.js.

MIT Licence NPM version NPM downloads

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

  • isArray
  • isArrayBuffer
  • isBigInt
  • isBlob
  • isBoolean
  • isBuffer
  • isDate
  • isEnum
  • isError
  • isFalsy
  • isFunction
  • isNaNumber
  • isNothing
  • isNull
  • isNullOrUndefined
  • isNumber
  • isObject
  • isPromise
  • isRegExp
  • isString
  • isSymbol
  • isTruthy
  • isUndefined
  • isURL
  • isURLSearchParams
  • isVoid

πŸš€ Tecnologies

The following tools were used in the construction of the project:

πŸ“¦ Install

Use the package manager npm, yarn.

npm install @geisonjr/type-checker
yarn add @geisonjr/type-checker

πŸ—οΈ Usage

Example with True Condition

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

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

About

License:MIT License


Languages

Language:TypeScript 99.7%Language:JavaScript 0.3%