UNPKG

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