Socket
Socket
Sign inDemoInstall

wrap-ansi

Package Overview
Dependencies
Maintainers
3
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wrap-ansi - npm Package Compare versions

Comparing version 0.3.0 to 1.0.0

15

index.js

@@ -100,5 +100,3 @@ 'use strict';

var ret = '';
var insideEscape = false;
var escapeCode;
var visible = 0;

@@ -127,3 +125,3 @@ var lengths = wordLengths(str);

if (rowLength + lengths[i] > cols) {
if (rowLength + lengths[i] > cols && rowLength > 0) {
rows.push('');

@@ -139,4 +137,2 @@ }

visible = 0;
for (var j = 0; j < pre.length; j++) {

@@ -150,13 +146,4 @@ var y = pre[j];

escapeCode = code === END_CODE ? null : code;
} else if (insideEscape && y === 'm') {
insideEscape = false;
continue;
}
if (insideEscape) {
continue;
}
visible++;
if (escapeCode && ESCAPE_CODES[escapeCode]) {

@@ -163,0 +150,0 @@ if (pre[j + 1] === '\n') {

3

package.json
{
"name": "wrap-ansi",
"version": "0.3.0",
"version": "1.0.0",
"description": "Wordwrap a string with ANSI escape codes",

@@ -62,2 +62,3 @@ "license": "MIT",

"coveralls": "^2.11.4",
"has-ansi": "^2.0.0",
"nyc": "^3.2.2",

@@ -64,0 +65,0 @@ "strip-ansi": "^3.0.0",

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