mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
Fixed issue with binding when binding to a falsy object (also added types.isNullOrundefined function).
This commit is contained in:
@ -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.");
|
||||
|
Reference in New Issue
Block a user