Files
NapCatQQ/.pnpm-store/v3/files/81/d60c25aaa0c10b1770caeeb4f69ca4fcb3ebbb9f6e74ae85d2f8f3a6a85c993c408ad6f25958e09c4d6f672aa45b24dc9f3ee8d65bfed856529c8fb9461e8f
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

25 lines
485 B
Plaintext

'use strict';
var callBound = require('call-bound');
var $PromiseThen = callBound('Promise.prototype.then', true);
var isObject = require('es-object-atoms/isObject');
// https://262.ecma-international.org/6.0/#sec-ispromise
module.exports = function IsPromise(x) {
if (!isObject(x)) {
return false;
}
if (!$PromiseThen) { // Promises are not supported
return false;
}
try {
$PromiseThen(x); // throws if not a promise
} catch (e) {
return false;
}
return true;
};