UNPKG

@tsdotnet/linq

Version:

A familiar set of functions that operate on JavaScript iterables (ES2015+) in a similar way to .NET's LINQ does with enumerables.

18 lines (16 loc) 384 B
function distinct(sequence) { return { *[Symbol.iterator]() { const s = new Set(); for (const e of sequence) { if (s.has(e)) continue; s.add(e); yield e; } s.clear(); } }; } export { distinct as default }; //# sourceMappingURL=distinct.js.map