AutoNumbering

AutoNumbering

AutoNumbering Extends SequentialText to support formatted auto-numbered items like `"1. Step A"`. Useful for numbering tests, documentation sections, or steps in a procedure. Example: ```js const an = new AutoNumbering(); an.next("Initialize DB"); // "1. Initialize DB" an.next("Check Schema"); // "2. Check Schema" ```

Constructor

new AutoNumbering(startValueopt, numberingTextFormatopt)

Description:
  • Constructs an auto-numbering generator that prefixes a number to each item. This is a convenience wrapper around `SequentialText` for cases where you want numbered outputs like "1. Item A", "2. Item B", etc.
Source:
Parameters:
Name Type Attributes Default Description
startValue number <optional>
1 Starting number for the sequence.
numberingTextFormat string <optional>
"{0}. " Format for the numeric prefix. The string must contain "{0}" as a placeholder.

Classes

AutoNumbering

Methods

next(textopt) → {string}

Description:
  • Generates the next string in the sequence by prefixing a number to the given text. This method calls the base `next()` to get the current number and appends the optional string after it.
Source:
Parameters:
Name Type Attributes Default Description
text string <optional>
"" Optional content to append after the number.
Returns:
Numbered string like "1. Hello"
Type
string