Socket
Socket
Sign inDemoInstall

string-width

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string-width - npm Package Compare versions

Comparing version 5.1.0 to 5.1.1

2

index.d.ts

@@ -5,3 +5,3 @@ export interface Options {

@default false
@default true
*/

@@ -8,0 +8,0 @@ readonly ambiguousIsNarrow: boolean;

@@ -10,2 +10,7 @@ import stripAnsi from 'strip-ansi';

options = {
ambiguousIsNarrow: true,
...options
};
string = stripAnsi(string);

@@ -19,3 +24,3 @@

const ambiguousCharWidth = options.ambiguousIsNarrow ? 1 : 2;
const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
let width = 0;

@@ -43,3 +48,3 @@

case 'A':
width += ambiguousCharWidth;
width += ambiguousCharacterWidth;
break;

@@ -46,0 +51,0 @@ default:

{
"name": "string-width",
"version": "5.1.0",
"version": "5.1.1",
"description": "Get the visual width of a string - the number of columns required to display it",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc