change-case
Advanced tools
Comparing version 5.4.0 to 5.4.1
@@ -5,3 +5,3 @@ // Regexps involved with splitting words in various case formats. | ||
// Used to iterate over the initial split result and separate numbers. | ||
const SPLIT_SEPARATE_NUMBER_RE = /(?<=\d)(\p{Ll})|(?<=\p{L})(\d)/u; | ||
const SPLIT_SEPARATE_NUMBER_RE = /(\d)\p{Ll}|(\p{L})\d/u; | ||
// Regexp involved with stripping non-word characters from the result. | ||
@@ -42,3 +42,4 @@ const DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu; | ||
if (match) { | ||
words.splice(i, 1, word.slice(0, match.index), word.slice(match.index)); | ||
const offset = match.index + (match[1] ?? match[2]).length; | ||
words.splice(i, 1, word.slice(0, offset), word.slice(offset)); | ||
} | ||
@@ -45,0 +46,0 @@ } |
{ | ||
"name": "change-case", | ||
"version": "5.4.0", | ||
"version": "5.4.1", | ||
"description": "Transform a string between `camelCase`, `PascalCase`, `Capital Case`, `snake_case`, `kebab-case`, `CONSTANT_CASE` and others", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
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
35158
328