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

ansi-rainbow

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ansi-rainbow - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

60

index.js

@@ -7,12 +7,12 @@ var ansi = require('ansi-styles')

var Pony = function() {
this._colors = [
this._colors = [
'red',
'green',
'green',
'yellow',
'blue',
'magenta',
'cyan',
'blue',
'magenta',
'cyan',
'white',
'black'
]
]

@@ -30,4 +30,4 @@ this._colors_num = this._colors.length

this._next = 0
this._prev = -1
this._next = 0
this._prev = -1

@@ -136,22 +136,20 @@ this.options = {color_space: false, gap: 1, space_color: null}

},
nextColor: function(s, colors) {
nextColor: function(s, colors) {
var l = colors.length - 1
var l = colors.length - 1
if(this._prev >= l) {
this._prev = 0, this._next = 1
if(this._prev >= l) {
this._prev = 0, this._next = 1
s = ansi[colors[0]].open + s + ansi[colors[0]].close
} else {
s = ansi[colors[this._next]].open + s + ansi[colors[this._next]].close
s = ansi[colors[0]].open + s + ansi[colors[0]].close
} else {
s = ansi[colors[this._next]].open + s + ansi[colors[this._next]].close
this._next++
this._prev++
}
this._prev++
}
this._current_gap++
return s
},
return s
},
currentColor: function(s, colors) {

@@ -175,9 +173,9 @@ var l = colors.length - 1

},
output: function(input, colors) {
var l = input.length, output = '', i = 0, gap = this.options.gap, s
output: function(input, colors) {
var l = input.length, output = '', i = 0, gap = this.options.gap, s
this._current_gap = gap
this._current_gap = 1
for (i; i < l; i++) {
this._current_gap = this._current_gap > gap ? gap : this._current_gap
this._current_gap = this._current_gap > gap ? 1 : this._current_gap
s = input.charAt(i)

@@ -196,11 +194,11 @@

}
}
}
//reset state
this._next = 0, this._prev = -1
//reset state
this._next = 0, this._prev = -1
return output
}
return output
}
}
module.exports = new Pony()
{
"name": "ansi-rainbow",
"version": "0.0.8",
"version": "0.0.9",
"description": "One of the most advanced ansi string rainbow stylizer tool",

@@ -5,0 +5,0 @@ "main": "index.js",

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