@luolapeikko/ts-common
    Preparing search index...

    Function excludeKeys

    • Filter and exclude specific keys from an object (Based on https://github.com/sindresorhus/filter-obj)

      Type Parameters

      • O extends Record<PropertyKey, any>

        The object to filter and exclude keys from

      • K extends string | number | symbol

        The key type

      Parameters

      • object: O

        The object to filter and exclude keys from

      • key: Iterable<K>

        The keys or keysCallback to exclude from the object

      Returns DistributiveOmit<O, K>

      A new object with the excluded keys

      const object = {
      foo: true,
      bar: false
      };
      const newObject = excludeKeys(object, (key, value) => value === true); //=> {bar: false}
      const newObject = excludeKeys(object, ['bar']); //=> {foo: true}

      v0.2.8

    • Filter and exclude specific keys from an object (Based on https://github.com/sindresorhus/filter-obj)

      Type Parameters

      • O extends Record<PropertyKey, any>

        The object to filter and exclude keys from

      • K extends string | number | symbol

        The key type

      Parameters

      • object: O

        The object to filter and exclude keys from

      • keyCallback: KeyCallback<O, K>

      Returns Partial<O>

      A new object with the excluded keys

      const object = {
      foo: true,
      bar: false
      };
      const newObject = excludeKeys(object, (key, value) => value === true); //=> {bar: false}
      const newObject = excludeKeys(object, ['bar']); //=> {foo: true}

      v0.2.8