(validate)
| 12586 | /*eslint-enable no-self-compare*/ |
| 12587 | |
| 12588 | function createChainableTypeChecker(validate) { |
| 12589 | function checkType(isRequired, props, propName, componentName, location, propFullName) { |
| 12590 | componentName = componentName || ANONYMOUS; |
| 12591 | propFullName = propFullName || propName; |
| 12592 | if (props[propName] == null) { |
| 12593 | var locationName = ReactPropTypeLocationNames[location]; |
| 12594 | if (isRequired) { |
| 12595 | return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.')); |
| 12596 | } |
| 12597 | return null; |
| 12598 | } else { |
| 12599 | return validate(props, propName, componentName, location, propFullName); |
| 12600 | } |
| 12601 | } |
| 12602 | |
| 12603 | var chainedCheckType = checkType.bind(null, false); |
| 12604 | chainedCheckType.isRequired = checkType.bind(null, true); |
| 12605 | |
| 12606 | return chainedCheckType; |
| 12607 | } |
| 12608 | |
| 12609 | function createPrimitiveTypeChecker(expectedType) { |
| 12610 | function validate(props, propName, componentName, location, propFullName) { |
no outgoing calls
no test coverage detected
searching dependent graphs…