Skip to content

Commit 8c614bb

Browse files
author
Kurtis LoVerde
committed
cross-browser method of determining object type
1 parent aff579d commit 8c614bb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

jquery.restrictedtextfield.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@
182182

183183
function isClassName( obj, className ) {
184184
var name = Object.prototype.toString.call( obj ).slice( 8, -1 );
185-
return obj !== undefined && obj !== null && name === className;
185+
return obj !== undefined && obj !== null && name.toUpperCase() === className.toUpperCase();
186186
}
187187

188188
function _addType( destination, id, fullRegex, partialRegex ) {
189189
if( id == undefined || id == null ) throw "id is undefined";
190-
if( !typeof(id) === "string" ) throw "id should be a string";
190+
if( !isClassName(id, "String") ) throw "id must be a string";
191191
if( id.length < 1 ) throw "id is empty";
192192

193193
if( fullRegex == undefined || fullRegex == null ) throw "fullRegex is undefined";

jquery.restrictedtextfield.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)