New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

isempty-typeof

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isempty-typeof

To check the data is empty or not. And also check the type of object wheater Array, Object, Function, Number, String or Boolean

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

isempty-typeof

To check the data is empty or not. And also check the type of object wheater Array, Object, Function, Number, String or Boolean. It is very light weight module.

Install

npm install isempty-typeof --save

How to require/import

import check from 'isempty-typeof';

or

const check = require('isempty-typeof');

Examples of how to use it

    // To check data is empty or not
    checks.isEmpty([]); // true
    checks.isEmpty([1,2]); // false
    checks.isEmpty({}); // true
    checks.isEmpty({a:"A"}); // false
    checks.isEmpty(0); // true
    checks.isEmpty(0,true); // false

    // To check the typeOf.
    checks.strictTypeOf([]); //Array
    checks.strictTypeOf([1,2]); //Array
    checks.strictTypeOf({}); //Object
    

Note

In isEmpty method if you consider zero not to a empty then send secound parameter true.

checks.isEmpty(0); // true
checks.isEmpty(0,true); // false

Keywords

javascript

FAQs

Package last updated on 11 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts