API Reference

Returns a string with additional characters added to achieve a particular length

function pad(
  str: string,
  length: number,
  char: string,
  style: "leading" | "trailing" = "trailing"
)

// Example:

pad("Hello", 10, ".") //=> "Hello....."