MCPcopy Create free account
hub / github.com/microsoft/SandDance / repeat

Function repeat

docs/app/js/sanddance-app.js:107087–107091  ·  view source on GitHub ↗
(str, reps)

Source from the content-addressed store, hash-verified

107085 return merged;
107086}
107087function repeat(str, reps) {
107088 let s = "";
107089 while(--reps >= 0)s += str;
107090 return s;
107091}
107092function pad(str, length, padchar, align) {
107093 const c = padchar || " ", s = str + "", n = length - s.length;
107094 return n <= 0 ? s : align === "left" ? repeat(c, n) + s : align === "center" ? repeat(c, ~~(n / 2)) + s + repeat(c, Math.ceil(n / 2)) : s + repeat(c, n);

Callers 1

padFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected