@types/object.omit
TypeScript icon, indicating that this package has built-in type declarations

3.0.3 • Public • Published

Installation

npm install --save @types/object.omit

Summary

This package contains type definitions for object.omit (https://github.com/jonschlinkert/object.omit).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/object.omit.

index.d.ts

type Omit<GType, GKeys extends keyof GType> = Pick<GType, Exclude<keyof GType, GKeys>>;

/**
 * Return a copy of an object excluding the given key, or array of keys. Also accepts an optional filter function as the last argument."
 *
 * ```ts
 * omit({a: 'a', b: 'b', c: 'c'}, ['a', 'c'])
 * //=> { b: 'b' }
 * ```
 *
 * @param object
 * @param keys
 */

declare function omit<GObject extends object, GKey extends keyof GObject>(
    object: GObject,
    key: GKey | GKey[],
): Omit<GObject, GKey>;

declare function omit<GObject extends object, GKey extends keyof GObject>(
    object: GObject,
    fn: (value: GObject[GKey], key: GKey, obj: GObject) => boolean,
): { [key: string]: any };

export = omit;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: none

Credits

These definitions were written by Ifiok Jr..

Readme

Keywords

none

Package Sidebar

Install

npm i @types/object.omit

Weekly Downloads

412,508

Version

3.0.3

License

MIT

Unpacked Size

3.96 kB

Total Files

5

Last publish

Collaborators

  • types