/** * @function pushToUniqueArray * @template T * @param {T[]} data - An array of objects. * @param {T} entry - The object to insert or replace with. * @param {(entry: T) => unknown} [getUniqueMethod] - Method to get the unique value of an entry. * @param {number} index - The index to insert the entry at, if it doesn't already exist. * @description - Append or replaces an item of an Array. * @returns {T[]} - Returns a new array with the updated entry. * @example