source:
node_modules/es-toolkit/dist/string/pad.mjs
| Last change on this file was a762898, checked in by , 5 months ago | |
|---|---|
|
|
| File size: 166 bytes | |
| Line | |
|---|---|
| 1 | function pad(str, length, chars = ' ') { |
| 2 | return str.padStart(Math.floor((length - str.length) / 2) + str.length, chars).padEnd(length, chars); |
| 3 | } |
| 4 | |
| 5 | export { pad }; |
Note:
See TracBrowser
for help on using the repository browser.
