🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

ts-object-utils

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-object-utils

Best type safe way to check null or undefined in typescript

0.0.1
Source
npm
Version published
Maintainers
1
Created
Source

ts-null-or-undefined

Best way to check for null or undefined in typescript using a type guard. Can strip out null or undefine or complex types like T | null etc.

To use:

import Type from "ts-null-or-undefined";

let a: number | null = 0;

console.log(a*4); //Error: a might be null

if(!Type.isNullOrUndefined(a)){
    console.log(a*4); //Works
}

FAQs

Package last updated on 20 Nov 2017

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