@servicenow/sdk - v4.4.1
    Preparing search index...
    ExtractArrayElement: T extends (infer U)[] ? U : T

    Extracts the element type from an array type. If the input is an array, returns the element type. Otherwise, returns the type itself (for backward compatibility).

    Type Parameters

    • T

      The type to extract the element from

    type StringArray = string[]
    type Element = ExtractArrayElement<StringArray> // string

    type RecordArray = Record<'incident'>[]
    type RecordElement = ExtractArrayElement<RecordArray> // Record<'incident'>