Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

repeat-string

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

repeat-string - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

20

index.js

@@ -10,3 +10,3 @@ /*!

module.exports = function repeat(str, num) {
module.exports = function repeat(str, count) {
if (typeof str !== 'string') {

@@ -16,9 +16,15 @@ throw new TypeError('repeat-string expects a string.');

var res = '';
if (count < 1) {
return '';
}
while (num--) {
res += str;
var result = '';
while (count > 0) {
if (count & 1) {
result += str;
}
count >>= 1;
str += str;
}
return res;
};
return result;
};
{
"name": "repeat-string",
"description": "Repeat the given string, n times.",
"version": "0.2.1",
"version": "0.2.2",
"homepage": "https://github.com/jonschlinkert/repeat-string",

@@ -6,0 +6,0 @@ "author": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc