常用判断函数

js
Updated: 2025-08-19

是否是promise 🔗

1
2
3
export function isPromise(object: any): object is Promise<any> {
  return Promise.resolve(object) === object;
}

Tags