Skip to main content

ExtendedItemValidate

Callable


  • Checks whether a change from the given current option to the newly selected option is valid.


    Type parameters

    Parameters

    • data: ExtendedItemData<T>

      The extended item data

    • C: Character

      The character wearing the item

    • Item: Item

      The extended item to validate

    • newOption: T

      The selected option

    • previousOption: T

      The currently applied option on the item

    • optionalpermitExisting: boolean = false

      Determines whether the validation should allow the new option and previous option to be identical. Defaults to false.

    Returns string

    • Returns a non-empty message string if the item failed validation, or an empty string otherwise