uniqBy(items, keyFn) {
    /** @type {Set<TKey>} */
    const seen = new Set();
    /** @type {Array<TArr>} */
    const out = [];

    for (const item of items) {
      const key = keyFn(item);
      if (seen.has(key)) continue;
      seen.add(key);
      out.push(item);
    }

    return out;
  }
Filters items by referential uniqueness of the value returned by keyFn.
Unique items are guaranteed to be in the same order of the original array.

@template TArr
@template TKey
@param {Array<TArr>} items
@param {(item: TArr) => TKey} keyFn
@return {Array<TArr>}