@pathmaker-digital/pmd-utilities - v2.2.6
    Preparing search index...

    Function updateInArray

    • Update an item in an array by matching a property and value. Returns a new array with the item updated.

      Type Parameters

      • T
      • K extends string | number | symbol

      Parameters

      • array: T[]

        The original array.

      • key: K

        The property key to match.

      • value: T[K]

        The value to match.

      • updater: (item: T) => T

        A export function that returns the updated item.

      Returns T[]

      A new array with the updated item.