StringArrayRotateFunctionTemplate.ts 426 B

12345678910111213141516
  1. /**
  2. * @returns {string}
  3. */
  4. export function StringArrayRotateFunctionTemplate (): string {
  5. return `
  6. (function (array, {timesName}) {
  7. const {whileFunctionName} = function (times) {
  8. while (--times) {
  9. array['push'](array['shift']());
  10. }
  11. };
  12. {code}
  13. })({stringArrayName}, {stringArrayRotationAmount});
  14. `;
  15. }