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

Function padStart

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

Source from the content-addressed store, hash-verified

15742 return [item];
15743};
15744function padStart(item, targetLength, padString) {
15745 if (padString === void 0) {
15746 padString = " ";
15747 }
15748 var str = String(item);
15749 targetLength = targetLength >> 0;
15750 if (str.length > targetLength) {
15751 return String(str);
15752 }
15753 targetLength = targetLength - str.length;
15754 if (targetLength > padString.length) {
15755 padString += repeat(padString, targetLength / padString.length);
15756 }
15757 return padString.slice(0, targetLength) + String(str);
15758}
15759var split = function(str, sep, num) {
15760 var splits = str.split(sep);
15761 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