Function DeleteKeyValuePair

  • Deletes a key-value pair from the provided dictionary based on the specified key. If the key is found, the corresponding key-value pair is removed, and the deleted pair is returned. If the key is not found, undefined is returned.

    Type Parameters

    • T

      The type of values stored in the dictionary.

    Parameters

    • dic: TStringObject<T>

      The dictionary object from which to delete the key-value pair.

    • key: string

      The key of the key-value pair to be deleted.

    • ignoreCase: boolean = false

      (Optional) If true, performs a case-insensitive key comparison.

    Returns undefined | {
        key: string;
        value: T;
    }

    • Returns undefined if the key-value pair is not found; otherwise, returns the deleted key-value pair.

Generated using TypeDoc