(propValue)
| 12737 | |
| 12738 | // Equivalent of `typeof` but with special handling for array and regexp. |
| 12739 | function getPropType(propValue) { |
| 12740 | var propType = typeof propValue; |
| 12741 | if (Array.isArray(propValue)) { |
| 12742 | return 'array'; |
| 12743 | } |
| 12744 | if (propValue instanceof RegExp) { |
| 12745 | // Old webkits (at least until Android 4.0) return 'function' rather than |
| 12746 | // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ |
| 12747 | // passes PropTypes.object. |
| 12748 | return 'object'; |
| 12749 | } |
| 12750 | return propType; |
| 12751 | } |
| 12752 | |
| 12753 | // This handles more types than `getPropType`. Only used for error messages. |
| 12754 | // See `createPrimitiveTypeChecker`. |
no outgoing calls
no test coverage detected