MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / padStart

Function padStart

codebase/sources/dhtmlxscheduler.js:15748–15762  ·  view source on GitHub ↗
(item, targetLength, padString)

Source from the content-addressed store, hash-verified

15746 return [item];
15747 };
15748 function padStart(item, targetLength, padString) {
15749 if (padString === void 0) {
15750 padString = " ";
15751 }
15752 var str = String(item);
15753 targetLength = targetLength >> 0;
15754 if (str.length > targetLength) {
15755 return String(str);
15756 }
15757 targetLength = targetLength - str.length;
15758 if (targetLength > padString.length) {
15759 padString += repeat(padString, targetLength / padString.length);
15760 }
15761 return padString.slice(0, targetLength) + String(str);
15762 }
15763 var split = function(str, sep, num) {
15764 var splits = str.split(sep);
15765 return num ? splits.slice(0, num).concat([splits.slice(num).join(sep)]) : splits;

Callers 1

timeToUntilStringFunction · 0.70

Calls 1

repeatFunction · 0.70

Tested by

no test coverage detected