UNPKG

everyutil

Version:

A comprehensive library of lightweight, reusable utility functions for JavaScript and TypeScript, designed to streamline common programming tasks such as string manipulation, array processing, date handling, and more.

13 lines (12 loc) 497 B
/** * Adds left and right padding to each line in a multi-line string. * * Example: padLines("a\nb", 2, 1) → " a \n b " * * @author @dailker * @param {string} str - The input string. * @param {number} [left=0] - Number of spaces to add to the left of each line. * @param {number} [right=0] - Number of spaces to add to the right of each line. * @returns {string} The padded string. */ export declare function padLines(str: string, left?: number, right?: number): string;