Skip to content

umutcanbolat/unrepeat

Repository files navigation

unrepeat

Build Status Conventional Changelog Test coverage NPM version NPM

The missing inverse of the javascript's repeat method.

Install

npm install unrepeat
yarn add unrepeat

Usage

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.

About

🔄 The missing inverse of the javascript's repeat method.

Resources

License

Stars

Watchers

Forks

Packages

No packages published