1.0.5 • Published 4 years ago

simple-value-check v1.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

simple value check

Install

npm install simple-value-check

example

Example Link.

Usage

import vk from 'simple-value-check';

console.log( vk.isObject({}) );
console.log( vk.isFunction(()=>{}) );
console.log( vk.isNumber(1) );
console.log( vk.isString("1") );
console.log( vk.isBoolean(true) );
console.log( vk.isNull(null) );
console.log( vk.isArray([]) );
console.log( vk.isHasOwnProp({a:1}) );
console.log( vk.isNotEmptyString("1"));
console.log( vk.isNotEmptyArray([1]) );
console.log( vk.isExist(2) );
console.log( vk.isUndefined(undefined) );
methodDescription
isObjectIf the constructor of value is an Object, true is returned; otherwise, false is.
isFunctionIf the constructor of value is an Function, true is returned; otherwise, false is.
isStringIf the value is an String, true is returned; otherwise, false is.
isBooleanIf the value is an Boolean, true is returned; otherwise, false is.
isNullIf the value is an Null, true is returned; otherwise, false is.
isArrayIf the value is an Array, true is returned; otherwise, false is.
isHasOwnPropIf the property exist, true is returned; otherwise, false is.
isNotEmptyStringIf the value is an String and not empty, true is returned; otherwise, false is.
isNotEmptyArrayIf the value is an Array and not empty, true is returned; otherwise, false is.
isExistIf the value is not null and undefined, true is returned; otherwise, false is.
isUndefinedIf the value is an undefined, true is returned; otherwise, false is.