blob: c77ba95ad5b4aefc607fe817e7ae960a791a9b62 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001define( [
2 "../var/class2type",
3 "../var/toString"
4], function( class2type, toString ) {
5
6"use strict";
7
8function toType( obj ) {
9 if ( obj == null ) {
10 return obj + "";
11 }
12
13 // Support: Android <=2.3 only (functionish RegExp)
14 return typeof obj === "object" || typeof obj === "function" ?
15 class2type[ toString.call( obj ) ] || "object" :
16 typeof obj;
17}
18
19return toType;
20} );