change-case
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -27,4 +27,4 @@ var acceptString = function (fn) { | ||
e.titleCase = e.title = acceptString(function (str, isSignificant) { | ||
return splitWords(str).map(function (word) { | ||
if (!isSignificant && (word.length < 3 || ~e.insignificantWords.indexOf(word))) { | ||
return splitWords(str).map(function (word, index) { | ||
if (index && !isSignificant && (word.length < 3 || ~e.insignificantWords.indexOf(word))) { | ||
return word; | ||
@@ -31,0 +31,0 @@ } |
{ | ||
"name": "change-case", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Convert strings between camelCase, PascalCase, Title Case, snake_case, etc", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -15,2 +15,3 @@ /* global describe, it */ | ||
it('should convert to title case', function () { | ||
assert.equal(changeCase.titleCase('a-simple-test'), 'A Simple Test'); | ||
assert.equal(changeCase.titleCase('this is a test'), 'This is a Test'); | ||
@@ -34,2 +35,3 @@ assert.equal(changeCase.titleCase('this_is_a_test'), 'This is a Test'); | ||
assert.equal(changeCase.pascalCase('Test-String'), 'TestString'); | ||
assert.equal(changeCase.pascalCase('a-test-again'), 'ATestAgain'); | ||
}); | ||
@@ -36,0 +38,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
7268
123