@taufik-nurrohman/is

1.0.1 • Public • Published

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)

Dependents (19)

Package Sidebar

Install

npm i @taufik-nurrohman/is

Weekly Downloads

123

Version

1.0.1

License

MIT

Unpacked Size

5.04 kB

Total Files

5

Last publish

Collaborators

  • taufik-nurrohman