All files / dist isPromise.js

81.82% Statements 9/11
56.25% Branches 9/16
75% Functions 3/4
100% Lines 6/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21    13x     13x   42x               42x 33x     9x  
"use strict";
 
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = isPromise;
 
function _typeof(obj) { Eif (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
 
/**
 * @private isPromise
 * @returns True when the value is a promise and false when
 * the value is not a promise
 */
function isPromise(value) {
  if (value !== null && _typeof(value) === 'object') {
    return value && typeof value.then === 'function';
  }
 
  return false;
}