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/app/emoji/client/function-isSet.js

20 lines
372 B

// http://stackoverflow.com/a/26990347 function isSet() from Gajus
export const isSet = function(fn) {
let value;
try {
value = fn();
} catch (e) {
value = undefined;
}
return value !== undefined;
};
export const isSetNotNull = function(fn) {
let value;
try {
value = fn();
} catch (e) {
value = null;
}
return value !== null && value !== undefined;
};