case-anything
Advanced tools
Comparing version 2.1.3 to 2.1.4
@@ -24,2 +24,7 @@ // Latin-1 Supplement | ||
} | ||
const tail = string.slice(lastWordEndIndex).trim(); | ||
if (tail) { | ||
result.parts.push(''); | ||
result.prefixes.push(tail); | ||
} | ||
return result; | ||
@@ -38,3 +43,4 @@ } | ||
const partsAndIndexes = getPartsAndIndexes(normalString, split); | ||
return partsAndIndexes.parts.map((_part, i) => { | ||
return partsAndIndexes.parts | ||
.map((_part, i) => { | ||
let foundPrefix = partsAndIndexes.prefixes[i] || ''; | ||
@@ -59,2 +65,4 @@ let part = _part; | ||
} | ||
if (!foundPrefix && !part) | ||
return ''; | ||
if (!hasSpaces) { | ||
@@ -71,3 +79,4 @@ // return the found prefix OR fall back to a given prefix | ||
return (foundPrefix || prefix) + part; | ||
}); | ||
}) | ||
.filter(Boolean); | ||
} | ||
@@ -74,0 +83,0 @@ /** |
@@ -30,2 +30,7 @@ (function (global, factory) { | ||
} | ||
const tail = string.slice(lastWordEndIndex).trim(); | ||
if (tail) { | ||
result.parts.push(''); | ||
result.prefixes.push(tail); | ||
} | ||
return result; | ||
@@ -44,3 +49,4 @@ } | ||
const partsAndIndexes = getPartsAndIndexes(normalString, split); | ||
return partsAndIndexes.parts.map((_part, i) => { | ||
return partsAndIndexes.parts | ||
.map((_part, i) => { | ||
let foundPrefix = partsAndIndexes.prefixes[i] || ''; | ||
@@ -65,2 +71,4 @@ let part = _part; | ||
} | ||
if (!foundPrefix && !part) | ||
return ''; | ||
if (!hasSpaces) { | ||
@@ -77,3 +85,4 @@ // return the found prefix OR fall back to a given prefix | ||
return (foundPrefix || prefix) + part; | ||
}); | ||
}) | ||
.filter(Boolean); | ||
} | ||
@@ -80,0 +89,0 @@ /** |
{ | ||
"name": "case-anything", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
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
47337
932