@jagaad/utils
    Preparing search index...

    Function getIndexMeta

    • Returns metadata about the index of an item in a list.

      const list = ['apple', 'banana', 'cherry'];
      const meta = getIndexMeta(1, list);
      console.log(meta.count); // 3
      console.log(meta.current); // 2
      console.log(meta.first); // false
      console.log(meta.last); // false
      console.log(meta.odd); // true
      console.log(meta.even); // false

      Parameters

      Returns {
          get count(): number;
          get current(): number;
          get even(): boolean;
          get first(): boolean;
          get last(): boolean;
          get odd(): boolean;
      }

      • get count(): number

        The total number of items in the list.

      • get current(): number

        The current index (1-based).

      • get even(): boolean

        Whether the index is even (0-based).

      • get first(): boolean

        Whether this is the first item in the list.

      • get last(): boolean

        Whether this is the last item in the list.

      • get odd(): boolean

        Whether the index is odd (0-based).