DEPRECATED REPO: This module has been renamed to unrepeat. Please use it instead. https://github.com/umutcanbolat/unrepeat
A reversed approach to the javascript's repeat method.
npm install reverse-repeat --save
yarn add reverse-repeat
const reverseRepeat = require('reverse-repeat');
'foobar'.repeat(3);
//=> 'foobarfoobarfoobar'
reverseRepeat('foobarfoobarfoobar').repeated;
//=> 'foobar'
reverseRepeat('foobarfoobarfoobar').count;
//=> 3
var chorus = 'Because I\'m happy. ';
chorus.repeat(3);
//=> 'Because I'm happy. Because I'm happy. Because I'm happy. '
reverseRepeat(chorus.repeat(3));
//=> { repeated: 'Because I\'m happy. ', count: 3 }
Developed by Umut Canbolat.
This project is licensed under the MIT License - see the LICENSE file for details