Logos DX
    Preparing search index...

    Type Alias OneOrMany<T>

    OneOrMany: T | T[]

    Represents either a single item or an array of items.

    Essential for flexible APIs that accept both individual items and collections, reducing the need for separate method overloads.

    Type Parameters

    • T
    function addClass(elements: OneOrMany<Element>, className: string): void
    addClass(document.body, 'active'); // single element
    addClass([el1, el2], 'active'); // multiple elements