MCPcopy Create free account
hub / github.com/plotly/dash / getPropType

Function getPropType

dash/deps/prop-types@15.8.1.js:719–734  ·  view source on GitHub ↗
(propValue)

Source from the content-addressed store, hash-verified

717
718 // Equivalent of `typeof` but with special handling for array and regexp.
719 function getPropType(propValue) {
720 var propType = typeof propValue;
721 if (Array.isArray(propValue)) {
722 return 'array';
723 }
724 if (propValue instanceof RegExp) {
725 // Old webkits (at least until Android 4.0) return 'function' rather than
726 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
727 // passes PropTypes.object.
728 return 'object';
729 }
730 if (isSymbol(propType, propValue)) {
731 return 'symbol';
732 }
733 return propType;
734 }
735
736 // This handles more types than `getPropType`. Only used for error messages.
737 // See `createPrimitiveTypeChecker`.

Callers 2

validateFunction · 0.70
getPreciseTypeFunction · 0.70

Calls 1

isSymbolFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…