RocketChat/Rocket.Chat

View on GitHub
apps/meteor/app/emoji-emojione/lib/isSetNotNull.ts

Summary

Maintainability
A
0 mins
Test Coverage
// http://stackoverflow.com/a/26990347 function isSet() from Gajus
export const isSetNotNull = async (fn: () => unknown) => {
    let value;
    try {
        value = await fn();
    } catch (e) {
        value = null;
    }
    return value !== null && value !== undefined;
};