You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP →
Socket
Book a DemoSign in
Socket

string-width

Package Overview
Dependencies
Maintainers
1
Versions
28
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
4.2.0
to
4.2.1
+5
-1
index.js

@@ -7,5 +7,9 @@ 'use strict';

const stringWidth = string => {
if (typeof string !== 'string' || string.length === 0) {
return 0;
}
string = string.replace(emojiRegex(), ' ');
if (typeof string !== 'string' || string.length === 0) {
if (string.length === 0) {
return 0;

@@ -12,0 +16,0 @@ }

+1
-1
{
"name": "string-width",
"version": "4.2.0",
"version": "4.2.1",
"description": "Get the visual width of a string - the number of columns required to display it",

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

@@ -1,2 +0,2 @@

# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width)
# string-width

@@ -3,0 +3,0 @@ > Get the visual width of a string - the number of columns required to display it