import type { Waitable } from './types/waitable'; /** Checks if the specified value is a waitable */ export const isWaitable = (value: any): value is Waitable => value !== null && typeof value === 'object' && 'isWaitable' in value && (value as { isWaitable: unknown }).isWaitable === true; /** Returns a readonly waitable if the specified value is a waitable. Otherwise, returns undefined */ export const ifWaitable = (value: any): Waitable | undefined => isWaitable(value) ? (value as Waitable) : undefined;