The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/rocketchat-emoji/client/function-isSet.js

25 lines
453 B

/* globals isSet:true, isSetNotNull:true */
//http://stackoverflow.com/a/26990347 function isSet() from Gajus
isSet = function(fn) {
let value;
try {
value = fn();
} catch (e) {
value = undefined;
} finally {
return value !== undefined;
}
};
isSetNotNull = function(fn) {
let value;
try {
value = fn();
} catch (e) {
value = null;
} finally {
return value !== null && value !== undefined;
}
};
/* exported isSet, isSetNotNull */