2.1.1 • Published 5 years ago
unrepeat v2.1.1
unrepeat
The missing inverse of the javascript's repeat method.
Install
npm install unrepeatyarn add unrepeatUsage
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 }Contributing
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.
Releasing
See RELEASING for details.
Credits
Developed by Umut Canbolat.
License
This project is licensed under the MIT License - see the LICENSE file for details.