common-stuff
    Preparing search index...

    Function filterRecord

    • Filter object by provided callback.

      Type Parameters

      • K extends PropertyKey
      • V

      Parameters

      • obj: Record<K, V>

        Record like plain object

      • callback: (entry: [K, V]) => boolean

        map callback, accepts entry pair ([key, value]) and should boolean value

      Returns Record<K, V>

      new filtered object

      filterRecord({'a': 2, 'b': 3}, ([k, v]) => v === 2)
      >> {'a': 2}

      Use [[filter]] from iterable instead — it handles Record directly along with Array, Set, Map, and (async) iterables.