UNPKG

@difizen/mana-common

Version:

21 lines (20 loc) 772 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isPromise = isPromise; exports.isPromiseLike = isPromiseLike; exports.toArray = toArray; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function toArray(v) { if (Array.isArray(v)) { return v; } return [v]; } function isPromise(obj) { return !!obj && (_typeof(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; } function isPromiseLike(obj) { return isPromise(obj); }