export function contains(source: Iterable, target: T, compare?: (x: T, y: T) => boolean): boolean { if (source) { compare = compare || ((x, y) => x === y) for (let item of source) { if (compare(item, target)) { return true } } } return false }