Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Commit

Permalink
Inline the has module
Browse files Browse the repository at this point in the history
  • Loading branch information
getkey committed Jun 19, 2018
1 parent 6fef996 commit 2200d8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion factoryWithTypeCheckers.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var assign = require('object-assign');
var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
var checkPropTypes = require('./checkPropTypes');

var has = Function.call.bind(Object.prototype.hasOwnProperty);
var printWarning = function() {};

if (process.env.NODE_ENV !== 'production') {
Expand Down Expand Up @@ -318,7 +319,7 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
}
for (var key in propValue) {
if (Object.prototype.hasOwnProperty.call(propValue, key)) {
if (has(propValue, key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error instanceof Error) {
return error;
Expand Down

0 comments on commit 2200d8d

Please sign in to comment.