sentence-case
Advanced tools
Comparing version 1.0.3 to 1.1.0
@@ -22,1 +22,2 @@ var fs = require('fs'); | ||
write('camel-case-regexp.js', new XRegExp('(\\p{Ll})([\\p{Lu}\\p{N}])', 'g')); | ||
write('trailing-digit-regexp.js', new XRegExp('(\\p{N})(\\p{^N})', 'g')); |
{ | ||
"name": "sentence-case", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "Sentence case a string", | ||
@@ -5,0 +5,0 @@ "main": "sentence-case.js", |
@@ -1,3 +0,4 @@ | ||
var NON_WORD_REGEXP = require('./vendor/non-word-regexp.js'); | ||
var CAMEL_CASE_REGEXP = require('./vendor/camel-case-regexp.js'); | ||
var NON_WORD_REGEXP = require('./vendor/non-word-regexp.js'); | ||
var CAMEL_CASE_REGEXP = require('./vendor/camel-case-regexp.js'); | ||
var TRAILING_DIGIT_REGEXP = require('./vendor/trailing-digit-regexp.js'); | ||
@@ -18,2 +19,4 @@ /** | ||
.replace(CAMEL_CASE_REGEXP, '$1 $2') | ||
// Add a space after any digits. | ||
.replace(TRAILING_DIGIT_REGEXP, '$1 $2') | ||
// Remove all non-word characters and replace with a single space. | ||
@@ -20,0 +23,0 @@ .replace(NON_WORD_REGEXP, ' ') |
@@ -45,3 +45,6 @@ /* global describe, it */ | ||
['Beyoncé Knowles', 'beyoncé knowles'], | ||
['Iñtërnâtiônàlizætiøn', 'iñtërnâtiônàlizætiøn'] | ||
['Iñtërnâtiônàlizætiøn', 'iñtërnâtiônàlizætiøn'], | ||
// Number string input. | ||
['something2014other', 'something 2014 other'] | ||
]; | ||
@@ -48,0 +51,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
21659
11
93