VulpesOS/gaia/shared/js/format.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

25 lines
549 B
JavaScript
Executable file

/* exported Format */
'use strict';
/**
* format.js: simple formatters and string utilities.
*/
var Format = {
/**
* Pads a string to the number of characters specified.
* @param {String} input value to add padding to.
* @param {Integer} len length to pad to.
* @param {String} padWith char to pad with (defaults to " ").
*/
padLeft: function(input, len, padWith) {
padWith = padWith || ' ';
var pad = len - (input + '').length;
while (--pad > -1) {
input = padWith + input;
}
return input;
}
};