omitDictionaryItemsconstant

omitDictionaryItems: <T>(dict: ImmutableDictionary<T>, ...keys: string[]) => ImmutableDictionary<T>
Return
unknown
A new dictionary without the removed items, or the original dictionary if no keys were present.

Remove several items from a dictionary object (immutably) and return a new object without those items.

  • If none of the keys exist the original dictionary is returned unchanged.

Examples

omitDictionaryItems({ a: 1, b: 2, c: 3 }, "b", "c"); // { a: 1 }