import { Comparable } from './Types' export const isIterable = (value: unknown): value is Iterable => { if (value == null) { return false } const itr = value as Iterable if (itr[Symbol.iterator] == null) { return false } return true } export const isComparable = (object: unknown): object is Comparable => { const toString = Object.prototype.toString const cast = object as Record return cast.compare != null && toString.call(cast.compare).endsWith('Function]') } export const isDate = (value: unknown): value is Date => { const toString = Object.prototype.toString return toString.call(value).endsWith('Date]') }