(validate)
| 12505 | }; |
| 12506 | |
| 12507 | function createChainableTypeChecker(validate) { |
| 12508 | function checkType(isRequired, props, propName, componentName, location, propFullName) { |
| 12509 | componentName = componentName || ANONYMOUS; |
| 12510 | propFullName = propFullName || propName; |
| 12511 | if (props[propName] == null) { |
| 12512 | var locationName = ReactPropTypeLocationNames[location]; |
| 12513 | if (isRequired) { |
| 12514 | return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.')); |
| 12515 | } |
| 12516 | return null; |
| 12517 | } else { |
| 12518 | return validate(props, propName, componentName, location, propFullName); |
| 12519 | } |
| 12520 | } |
| 12521 | |
| 12522 | var chainedCheckType = checkType.bind(null, false); |
| 12523 | chainedCheckType.isRequired = checkType.bind(null, true); |
| 12524 | |
| 12525 | return chainedCheckType; |
| 12526 | } |
| 12527 | |
| 12528 | function createPrimitiveTypeChecker(expectedType) { |
| 12529 | function validate(props, propName, componentName, location, propFullName) { |
no outgoing calls
no test coverage detected