return str.charAt( 0 ).toUpperCase() + str.substr( 1 );
},
escapeRE: function ( str ) {
- return str.replace ( /([\\{}()|.?*+\-\^$\[\]])/g, "\\$1" );
+ return str.replace ( /([\\{}()|.?*+\-\^$\[\]])/g, '\\$1' );
},
isDomElement: function ( el ) {
return !!el && !!el.nodeType;
},
isEmpty: function ( v ) {
+ var key;
if ( v === '' || v === 0 || v === '0' || v === null
|| v === false || v === undefined )
{
return true;
}
if ( typeof v === 'object' ) {
- for ( var key in v ) {
+ for ( key in v ) {
return false;
}
return true;
return true;
},
compareObject: function ( objectA, objectB ) {
+ var prop, type;
// Do a simple check if the types match
if ( typeof objectA === typeof objectB ) {
if ( objectA === objectB ) {
return true;
} else {
- var prop;
// Iterate over each property
for ( prop in objectA ) {
// Check if this property is also present in the other object
if ( prop in objectB ) {
// Compare the types of the properties
- var type = typeof objectA[prop];
+ type = typeof objectA[prop];
if ( type === typeof objectB[prop] ) {
// Recursively check objects inside this one
switch ( type ) {