sentence-case
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "sentence-case", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Sentence case a string", | ||
@@ -5,0 +5,0 @@ "main": "sentence-case.js", |
@@ -16,5 +16,3 @@ /** | ||
// Remove every non-word character and replace with a period. | ||
.replace(/[^a-zA-Z0-9]+/g, '.') | ||
// Replace every period not between two numbers with a space. | ||
.replace(/(?!\d\.\d)(^|.)\./g, '$1 ') | ||
.replace(/[^a-zA-Z0-9]+/g, ' ') | ||
// Trim whitespace from the string. | ||
@@ -21,0 +19,0 @@ .replace(/^ | $/g, '') |
@@ -26,6 +26,6 @@ /* global describe, it */ | ||
it('should have special support for numbers', function () { | ||
assert.equal(sentenceCase('version 0.45.0'), 'version 0.45.0'); | ||
assert.equal(sentenceCase('version 0..78..0'), 'version 0.78.0'); | ||
assert.equal(sentenceCase('version.4_99/4'), 'version 4.99.4'); | ||
it('should keep spaces between numbers', function () { | ||
assert.equal(sentenceCase('version 0.45.0'), 'version 0 45 0'); | ||
assert.equal(sentenceCase('version 0..78..0'), 'version 0 78 0'); | ||
assert.equal(sentenceCase('version.4_99/4'), 'version 4 99 4'); | ||
}); | ||
@@ -32,0 +32,0 @@ |
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
5299
55