Get unlimited public & private packages + package-based permissions with npm Pro.Get started ¬Ľ

unrepeat

2.1.0¬†‚Äʬ†Public¬†‚Äʬ†Published

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.

Install

npm i unrepeat

DownloadsWeekly Downloads

0

Version

2.1.0

License

MIT

Unpacked Size

6.59 kB

Total Files

4

Last publish

Collaborators

  • avatar