(shapeTypes)
| 12753 | } |
| 12754 | |
| 12755 | function createShapeTypeChecker(shapeTypes) { |
| 12756 | function validate(props, propName, componentName, location, propFullName) { |
| 12757 | var propValue = props[propName]; |
| 12758 | var propType = getPropType(propValue); |
| 12759 | if (propType !== 'object') { |
| 12760 | var locationName = ReactPropTypeLocationNames[location]; |
| 12761 | return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); |
| 12762 | } |
| 12763 | for (var key in shapeTypes) { |
| 12764 | var checker = shapeTypes[key]; |
| 12765 | if (!checker) { |
| 12766 | continue; |
| 12767 | } |
| 12768 | var error = checker(propValue, key, componentName, location, propFullName + '.' + key); |
| 12769 | if (error) { |
| 12770 | return error; |
| 12771 | } |
| 12772 | } |
| 12773 | return null; |
| 12774 | } |
| 12775 | return createChainableTypeChecker(validate); |
| 12776 | } |
| 12777 | |
| 12778 | function isNode(propValue) { |
| 12779 | switch (typeof propValue) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…