ts-commons
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -10,2 +10,3 @@ export declare class ObjectUtils { | ||
static isBoolean(value: any): boolean; | ||
static toSafeString(value: any): string; | ||
} |
@@ -30,2 +30,12 @@ "use strict"; | ||
}; | ||
// return "" if value is null or undefined. | ||
// from C# https://docs.microsoft.com/en-us/dotnet/api/microsoft.toolkit.extensions.stringextensions.tosafestring?view=uwp-toolkit-dotnet | ||
ObjectUtils.toSafeString = function (value) { | ||
if (this.isNullOrUndefined(value)) { | ||
return ""; | ||
} | ||
else { | ||
return value.toString(); | ||
} | ||
}; | ||
return ObjectUtils; | ||
@@ -32,0 +42,0 @@ }()); |
{ | ||
"name": "ts-commons", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "common methods for typescript", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
58047
766