Function

omit

@ng-forge/dynamic-forms

Creates a new object without the specified keys Native replacement for lodash omit()

Signature

function omit<
  T extends object,
  K extends keyof T
>(
  obj: T,
  keys: K[]
): Omit<T, K>

Type Parameters

NameConstraintDefaultDescription
Tobject--
Kkeyof T--

Parameters

NameTypeDescription
objT- Source object
keysK[]- Keys to omit

Returns

Omit<T, K>

Examples

const obj = { a: 1, b: 2, c: 3 };
omit(obj, ['b']); // { a: 1, c: 3 }