Permalink
Browse files

Removed need for isPlainObject

  • Loading branch information...
1 parent 93fc28a commit 2db43cdc12716f234528147f38555eebf37899b6 InfinitiesLoop committed Jul 13, 2010
Showing with 8 additions and 5 deletions.
  1. +8 −5 jquery.glob.js
View
@@ -11,15 +11,15 @@ localized["default"] = localized.en;
$.findClosestCulture = function(name) {
var match;
if ( !name ) {
- match = $.culture || $.cultures["default"];
+ return $.culture || $.cultures["default"];
}
- else if ( $.isPlainObject( name ) ) {
- match = name;
+ if ( isString( name ) ) {
+ name = name.split( ',' );
}
- else {
+ if ( isArray( name ) ) {
var lang,
cultures = $.cultures,
- list = isArray( name ) ? name : name.split( ',' ),
+ list = name,
i, l = list.length,
prioritized = [];
for ( i = 0; i < l; i++ ) {
@@ -71,6 +71,9 @@ $.findClosestCulture = function(name) {
while ( 1 );
}
}
+ else if ( typeof name === 'object' ) {
+ return name;
+ }
return match || null;
}
$.preferCulture = function(name) {

0 comments on commit 2db43cd

Please sign in to comment.