UNPKG

553 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = isPromise;
7
8/**
9 * Copyright (c) 2015-present, Facebook, Inc.
10 *
11 * This source code is licensed under the MIT license found in the
12 * LICENSE file in the root directory of this source tree.
13 *
14 * strict
15 */
16
17/**
18 * Returns true if the value acts like a Promise, i.e. has a "then" function,
19 * otherwise returns false.
20 */
21// eslint-disable-next-line no-redeclare
22function isPromise(value) {
23 return Boolean(value && typeof value.then === 'function');
24}
\No newline at end of file