The missing inverse of the javascript's repeat method.
npm install unrepeat
yarn add unrepeat
import unrepeat from 'unrepeat';
'foobar'.repeat(3);
//=> 'foobarfoobarfoobar'
unrepeat('foobarfoobarfoobar').repeated;
//=> 'foobar'
unrepeat('foobarfoobarfoobar').count;
//=> 3
var chorus = "Because I'm happy. ";
chorus.repeat(3);
//=> 'Because I'm happy. Because I'm happy. Because I'm happy. '
unrepeat(chorus.repeat(3));
//=> { repeated: 'Because I\'m happy. ', count: 3 }
PR's are always welcome. There is only one thing to know before contributing. Commit messages must comply with conventional commits. Otherwise commitlint will complain. :)
Thanks to commitizen, npm run commit
command can be used to create commit messages complying with conventional commits.
See RELEASING for details.
Developed by Umut Canbolat.
This project is licensed under the MIT License - see the LICENSE file for details.