source: node_modules/es-toolkit/dist/compat/string/padEnd.d.mts

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 952 bytes
Line 
1/**
2 * Pads the end of a string with a given character until it reaches the specified length.
3 *
4 * If the length is less than or equal to the original string's length, or if the padding character is an empty string,
5 * the original string is returned unchanged.
6 *
7 * @param {string} str - The string to pad.
8 * @param {number} [length] - The length of the resulting string once padded.
9 * @param {string} [chars] - The character(s) to use for padding.
10 * @returns {string} - The padded string, or the original string if padding is not required.
11 *
12 * @example
13 * const result1 = padEnd('abc', 6); // result will be 'abc '
14 * const result2 = padEnd('abc', 6, '_-'); // result will be 'abc_-_'
15 * const result3 = padEnd('abc', 3); // result will be 'abc'
16 * const result4 = padEnd('abc', 2); // result will be 'abc'
17 */
18declare function padEnd(str?: string, length?: number, chars?: string): string;
19
20export { padEnd };
Note: See TracBrowser for help on using the repository browser.