@multi-kit/inspect
v0.0.20
Published
This library provides core functionalities for determining the type of a given object, supporting various JavaScript data types.
Downloads
141
Maintainers
Readme
JavaScript Type Checking Library
Introduction
This library provides core functionalities for determining the type of a given object, supporting various JavaScript data types.
Installation:
npm install @multi-kit/inspect
Usage:
import { isType, isString, isNumber, isArray } from '@multi-kit/inspect';
console.log(isType("String", "Hello")); // Output: true
console.log(isString("Hello")); // Output: true
console.log(isNumber(123)); // Output: true
console.log(isArray([1, 2, 3])); // Output: true
console.log(isArray("Not an array")); // Output: false
Function List
isType(type: string, target: unknown): boolean
isString(target: unknown): boolean
isNumber(target: unknown): boolean
isBoolean(target: unknown): boolean
isNull(target: unknown): boolean
isUndefined(target: unknown): boolean
isSymbol(target: unknown): boolean
isBigInt(target: unknown): boolean
isArray(target: unknown): boolean
isObject(target: unknown): boolean
isFunction(target: unknown): boolean
isAsyncFunction(target: unknown): boolean
isDate(target: unknown): boolean
isRegExp(target: unknown): boolean
isSet(target: unknown): boolean
isMap(target: unknown): boolean
isWeakSet(target: unknown): boolean
isWeakMap(target: unknown): boolean
isPromise(target: unknown): boolean
Contributing
Contributions to this library are welcome. If you encounter any issues or have suggestions for improvements, please submit an issue or pull request.
License
This project is licensed under the MIT License.