Created
June 13, 2016 12:03
-
-
Save ErrorProne/104ececf8f9ef10e9e64d9d90dba0169 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class TypeHelper { | |
static nullOrUndefined(variable:any):boolean { | |
return (variable === undefined || variable === null); | |
} | |
static value(variable:any, optional:any):any { | |
if (TypeHelper.nullOrUndefined(variable)) { | |
return optional; | |
} else { | |
return variable; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment