1 | define(["require", "exports"], function (require, exports) {
|
2 | "use strict";
|
3 | Object.defineProperty(exports, "__esModule", { value: true });
|
4 | exports.isPromiseOrContainsPromise = exports.isPromise = void 0;
|
5 | function isPromise(object) {
|
6 | var isObjectOrFunction = (typeof object === 'object' && object !== null) || typeof object === 'function';
|
7 | return isObjectOrFunction && typeof object.then === "function";
|
8 | }
|
9 | exports.isPromise = isPromise;
|
10 | function isPromiseOrContainsPromise(object) {
|
11 | if (isPromise(object)) {
|
12 | return true;
|
13 | }
|
14 | return Array.isArray(object) && object.some(isPromise);
|
15 | }
|
16 | exports.isPromiseOrContainsPromise = isPromiseOrContainsPromise;
|
17 | });
|
18 |
|
\ | No newline at end of file |