@nyaomaru/divider
    Preparing search index...

    Function dividerAt

    • Extracts a segment at the requested index after dividing the input.

      Negative indexes count backward from the final segment, matching Array.prototype.at semantics.

      Parameters

      • input: DividerInput

        String or array of strings to divide.

      • index: number

        Zero-based segment index to select.

      • ...args: DividerSegmentArgs

        Separators and optional segment-processing options.

      Returns string

      Selected segment, or an empty string for an invalid or missing index.

      dividerAt('first/middle/last', 1, '/') // returns 'middle'
      dividerAt('first/middle/last', -2, '/') // returns 'middle'