src/util/string-utils.ts
Methods |
|
Public convertToString | ||||||||
convertToString(value: any)
|
||||||||
Defined in src/util/string-utils.ts:5
|
||||||||
Parameters :
Returns :
string
|
import { isNullOrUndefined } from 'util';
export class StringUtils {
public static convertToString(value: any): string {
if ('string' === typeof value) {
return value;
}
return !isNullOrUndefined(value) ? value.toString() : null;
}
}