(propValue)
| 736 | // This handles more types than `getPropType`. Only used for error messages. |
| 737 | // See `createPrimitiveTypeChecker`. |
| 738 | function getPreciseType(propValue) { |
| 739 | if (typeof propValue === 'undefined' || propValue === null) { |
| 740 | return '' + propValue; |
| 741 | } |
| 742 | var propType = getPropType(propValue); |
| 743 | if (propType === 'object') { |
| 744 | if (propValue instanceof Date) { |
| 745 | return 'date'; |
| 746 | } else if (propValue instanceof RegExp) { |
| 747 | return 'regexp'; |
| 748 | } |
| 749 | } |
| 750 | return propType; |
| 751 | } |
| 752 | |
| 753 | // Returns a string that is postfixed to a warning about an invalid type. |
| 754 | // For example, "undefined" or "of type array" |
no test coverage detected
searching dependent graphs…