1.0.1 • Published 2 years ago

@taufik-nurrohman/is v1.0.1

Weekly downloads
14
License
MIT
Repository
github
Last release
2 years ago

Conditional Utility

I like to group all type checking tasks into helper functions like this to be used internally. This has the advantage in case of code minification.

These functions are very inspired by PHP which already has standard functions such as is_array(), is_object(), is_string(), etc.

Usage

CommonJS

const {isString} = require('@taufik-nurrohman/is');

console.log(isString('false'));

ECMAScript

import {isString} from '@taufik-nurrohman/is';

console.log(isString('false'));

Methods

isArray(any)

isBoolean(any)

isDefined(any)

isFloat(number)

isFunction(any)

isInstance(object, constructor)

isInteger(number)

isNull(any)

isNumber(any)

isNumeric(string)

isObject(any, isPlain = true)

isScalar(any)

isSet(any)

isString(any)

isVoid(any)