[Javascript] isPromiseLike

export const isPromiseLike = <T>(value: PromiseLike<T>) => value !== null && (typeof value === 'object' || typeof value === 'function') && typeof value.then === 'function'

 

posted @ 2024-09-15 01:57  Zhentiw  阅读(9)  评论(0)    收藏  举报