@sindresorhus/slugify
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -7,4 +7,4 @@ 'use strict'; | ||
return string | ||
.replace(/([a-z\d])([A-Z])/g, `$1 $2`) | ||
.replace(/([A-Z]+)([A-Z][a-z\d]+)/g, `$1 $2`); | ||
.replace(/([a-z\d])([A-Z])/g, '$1 $2') | ||
.replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1 $2'); | ||
}; | ||
@@ -20,3 +20,3 @@ | ||
for (const [key, value] of replacements) { | ||
string = string.replace(new RegExp(escapeStringRegexp(key), 'g'), ` ${value} `); | ||
string = string.replace(new RegExp(escapeStringRegexp(key), 'g'), value.length > 0 ? ` ${value} ` : value); | ||
} | ||
@@ -23,0 +23,0 @@ |
{ | ||
"name": "@sindresorhus/slugify", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Slugify a string", | ||
@@ -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
4581