string-length
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -5,4 +5,10 @@ 'use strict'; | ||
const stringLength = string => stripAnsi(string).match(charRegex()).length; | ||
const stringLength = string => { | ||
if (string === '') { | ||
return 0; | ||
} | ||
return stripAnsi(string).match(charRegex()).length; | ||
}; | ||
module.exports = stringLength; |
{ | ||
"name": "string-length", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes", | ||
@@ -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
4101
26