Sync check promise status. But core of CheckPromise is written by c++.
node.js
haven't expose one way to check a promise status. Although some trick can check promise status, that always are async way.
In addition, some monkey patch change promise constructor. you can't use instanceof
to check a object whether is a promise.and more,like zone.js
,although change promise constructor, the promise.then always return a promise maked by native Promise.This moment,you must use unconventional way to check.
cp.checkPromise(Promise.resolve())
cp.checkPromiseAsync(Promise.resolve).then(status => {
if(...)
})
cp.isPromise(Promise.resolve)
yarn add checkPromise