UNPKG

287 BJavaScriptView Raw
1function mod(x, y) {
2 return x - y * Math.floor(x / y);
3}
4function concat$(x, ...ys) {
5 for (var y of ys)
6 x.push(...y);
7 return x;
8}
9function rotate(x, n = 0) {
10 var n = mod(n, x.length);
11 return concat$(x.slice(n), x.slice(0, n));
12}
13export { rotate as default };