omitDictionaryItemconstant

omitDictionaryItem: <T>(dict: ImmutableDictionary<T>, key: string) => ImmutableDictionary<T>
Return
unknown
A new dictionary without the removed item, or the original dictionary if the key was not present.

Remove an item from a dictionary object (immutably) and return a new object without that item.

  • If the key doesn't exist the original dictionary is returned unchanged.

Examples

omitDictionaryItem({ a: 1, b: 2 }, "b"); // { a: 1 }