Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame] | 1 | define( [ |
2 | "../var/class2type", | ||||
3 | "../var/toString" | ||||
4 | ], function( class2type, toString ) { | ||||
5 | |||||
6 | "use strict"; | ||||
7 | |||||
8 | function 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 | |||||
19 | return toType; | ||||
20 | } ); |