UNPKG

@lou.codes/predicates

Version:
17 lines (16 loc) 509 B
/** * Check if given object has the `Symbol.asyncIterator` symbol. * * @category Iterables * @category Objects * @example * ```typescript * hasAsyncIteratorSymbol({ [Symbol.asyncIterator]() {} }); // true * hasAsyncIteratorSymbol({ bar: "bar" }); // false * ``` * @returns `true` when given object has the `Symbol.asyncIterator` symbol, * `false` otherwise. */ export declare const hasAsyncIteratorSymbol: ( object: unknown, ) => object is Readonly<Record<typeof Symbol.asyncIterator, unknown>>;