string-width
Advanced tools
Comparing version 5.1.0 to 5.1.1
@@ -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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5813
65