function isPromise(arg) {
        return (
            typeof arg === 'object' &&
                arg !== null &&
                'then' in arg &&
                typeof arg.then === 'function'
        );
    }
@param {Object} arg - expression to test
@returns {boolean} - true if it is a promise