unrepeat
TypeScript icon, indicating that this package has built-in type declarations

2.1.1 • 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.

Package Sidebar

Install

npm i unrepeat

Weekly Downloads

1

Version

2.1.1

License

MIT

Unpacked Size

10 kB

Total Files

8

Last publish

Collaborators

  • umutcanbolat