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

ts-object-utils

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-object-utils - npm Package Compare versions

Comparing version

to
0.0.5

export declare class Default {
static value<T>(obj: any, defaultValue: T): T;
static value<T>(obj: T | null | undefined, defaultValue: T): T;
}
{
"name": "ts-object-utils",
"version": "0.0.4",
"version": "0.0.5",
"description": "Best type safe way to check null or undefined in typescript",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

import { ObjectUtil } from "./ObjectUtil";
export class Default {
public static value<T>(obj: any, defaultValue: T): T {
public static value<T>(obj: T | null | undefined, defaultValue: T): T {
return ObjectUtil.isNullOrUndefined(obj) ? defaultValue : obj;
}
}

Sorry, the diff of this file is not supported yet