Fixed issue with binding when binding to a falsy object (also added types.isNullOrundefined function).

This commit is contained in:
Nedyalko Nikolov
2015-04-20 14:24:17 +03:00
parent 9550ebc144
commit 6bb533dc30
7 changed files with 25 additions and 10 deletions

View File

@ -21,6 +21,10 @@ export function isDefined(value: any): boolean {
return typeof value !== "undefined";
}
export function isNullOrUndefined(value: any): boolean {
return (typeof value === "undefined") || (value === null);
}
export function verifyCallback(value: any) {
if (value && !isFunction(value)) {
throw new TypeError("Callback must be a valid function.");