UNPKG

@lou.codes/predicates

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