Socket
Socket
Sign inDemoInstall

wrap-ansi

Package Overview
Dependencies
8
Maintainers
3
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.1.0 to 6.0.0

19

index.js

@@ -24,3 +24,3 @@ 'use strict';

let insideEscape = false;
let isInsideEscape = false;
let visible = stringWidth(stripAnsi(rows[rows.length - 1]));

@@ -39,9 +39,9 @@

if (ESCAPES.has(character)) {
insideEscape = true;
} else if (insideEscape && character === 'm') {
insideEscape = false;
isInsideEscape = true;
} else if (isInsideEscape && character === 'm') {
isInsideEscape = false;
continue;
}
if (insideEscape) {
if (isInsideEscape) {
continue;

@@ -85,7 +85,5 @@ }

// The wrap-ansi module can be invoked
// in either 'hard' or 'soft' wrap mode
// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode
//
// 'hard' will never allow a string to take up more
// than columns characters
// 'hard' will never allow a string to take up more than columns characters
//

@@ -125,4 +123,3 @@ // 'soft' allows long words to expand past the column length

// In 'hard' wrap mode, the length of a line is
// never allowed to extend past 'columns'
// In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns'
if (options.hard && lengths[index] > columns) {

@@ -129,0 +126,0 @@ const remainingColumns = (columns - rowLength);

{
"name": "wrap-ansi",
"version": "5.1.0",
"version": "6.0.0",
"description": "Wordwrap a string with ANSI escape codes",

@@ -13,3 +13,3 @@ "license": "MIT",

"engines": {
"node": ">=6"
"node": ">=8"
},

@@ -50,14 +50,14 @@ "scripts": {

"dependencies": {
"ansi-styles": "^3.2.0",
"string-width": "^3.0.0",
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^5.0.0"
},
"devDependencies": {
"ava": "^1.2.1",
"ava": "^2.1.0",
"chalk": "^2.4.2",
"coveralls": "^3.0.3",
"has-ansi": "^3.0.0",
"nyc": "^13.3.0",
"nyc": "^14.1.1",
"xo": "^0.24.0"
}
}

@@ -27,24 +27,10 @@ # wrap-ansi [![Build Status](https://travis-ci.org/chalk/wrap-ansi.svg?branch=master)](https://travis-ci.org/chalk/wrap-ansi) [![Coverage Status](https://coveralls.io/repos/github/chalk/wrap-ansi/badge.svg?branch=master)](https://coveralls.io/github/chalk/wrap-ansi?branch=master)

---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-wrap_ansi?utm_source=npm-wrap-ansi&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>
---
## API
### wrapAnsi(input, columns, [options])
### wrapAnsi(string, columns, options?)
Wrap words to the specified column width.
#### input
#### string

@@ -63,3 +49,3 @@ Type: `string`

Type: `Object`
Type: `object`

@@ -103,9 +89,12 @@ ##### hard

## Security
---
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
## License
MIT
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-wrap_ansi?utm_source=npm-wrap-ansi&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc