Skip to content

RomanBurunkov/tm-is

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tm-is

npm codecov

JavaScript basic 'is' functions for Node.

Installation

npm i tm-is

Description

Module provides a bunch of functions which return true or false. All functions support zero or more arguments. If several arguments passed, all of them should meet function conditions. Conditions for each function described in the Functions section.

E.g.

  isObject({}); // true
  isObject({}, {}); // true
  isObject({}, 'str'); // false, since not all arguments are objects.

Functions

  • isEmpty: Returns true if passed argument is null, empty string or undefined.
  • isObject/isObj: Returns true if passed argument is an object except null.
  • isFunction/isFunc: Returns true if passed argument is a function.
  • isUndefined/isUndef: Returns true if passed argument is undefined.
  • isEqualArrays/isEqArr: Returns true if passed arguments are equal arrays.

Examples

const { isObject, isFunction } = require('tm-is');

console.log(isObject({})); // true
console.log(isObject(null)); // false
console.log(isObject('string')); // false

console.log(isFunction('null')); // false
console.log(isFunction('string')); // false
console.log(isFunction(() => { })); // true

About

JavaScript basic 'is' functions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published