inflection
Advanced tools
Comparing version 1.2.7 to 1.3.0
# History | ||
## 1.3.0 / 2013-12-11 | ||
- [refactoring] Move `var` out of loops | ||
- [refactoring] Change the way `camelize` acts to mimic 100% `Rails ActiveSupport Inflector camelize` | ||
## 1.2.7 / 2013-12-11 | ||
@@ -4,0 +11,0 @@ |
@@ -293,13 +293,18 @@ /*! | ||
camelize : function ( str, lowFirstLetter ){ | ||
var str_path = str.toLowerCase().split( '/' ); | ||
var str_path = str.split( '/' ); | ||
var i = 0; | ||
var j = str_path.length; | ||
var str_arr, init_x, k, l; | ||
for( ; i < j; i++ ){ | ||
var str_arr = str_path[ i ].split( '_' ); | ||
var initX = (( lowFirstLetter && i + 1 === j ) ? ( 1 ) : ( 0 )); | ||
var k = initX; | ||
var l = str_arr.length; | ||
str_arr = str_path[ i ].split( '_' ); | ||
init_x = (( lowFirstLetter && i + 1 === j ) ? ( 1 ) : ( 0 )); | ||
k = init_x; | ||
l = str_arr.length; | ||
for( ; k < l; k++ ){ | ||
if( k !== 0 ){ | ||
str_arr[ k ] = str_arr[ k ].toLowerCase(); | ||
} | ||
str_arr[ k ] = str_arr[ k ].charAt( 0 ).toUpperCase() + str_arr[ k ].substring( 1 ); | ||
@@ -437,7 +442,8 @@ } | ||
var j = str_arr.length; | ||
var d, k, l; | ||
for( ; i < j; i++ ){ | ||
var d = str_arr[ i ].split( '-' ); | ||
var k = 0; | ||
var l = d.length; | ||
d = str_arr[ i ].split( '-' ); | ||
k = 0; | ||
l = d.length; | ||
@@ -623,3 +629,3 @@ for( ; k < l; k++){ | ||
*/ | ||
inflector.version = '1.2.7'; | ||
inflector.version = '1.3.0'; | ||
/** | ||
@@ -626,0 +632,0 @@ * Exports module. |
{ | ||
"name" : "inflection", | ||
"version" : "1.2.7", | ||
"version" : "1.3.0", | ||
"description": "A port of inflection-js to node.js module", | ||
@@ -5,0 +5,0 @@ "keywords" : [ |
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
33656
540