String padStart for formatting without a library

Zero-padding a number has been a slice of a string of zeros concatenated with the value, which is short enough to write inline and long enough to get wrong at the boundary.

String(7).padStart(2, '0');            // "07"
String(minutes).padStart(2, '0');

// invoice numbers
`INV-${String(id).padStart(6, '0')}`;   // "INV-000091"

'abc'.padEnd(6, '.');                  // "abc..."

The pad string repeats and is truncated to fit, so a multi-character pad does something reasonable rather than erroring. It does nothing if the string is already at or beyond the target length — it never truncates, which is the opposite of what a fixed-width formatter usually wants and is worth checking when the input can be longer than expected.