Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sentence-case

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sentence-case - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc