Skip to content

Commit

Permalink
Revert "Replace hasOwnProperty with the more robust "has" package"
Browse files Browse the repository at this point in the history
This reverts commit e6a9b28.
  • Loading branch information
getkey committed Jun 19, 2018
1 parent e6a9b28 commit 6fef996
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions factoryWithTypeCheckers.js
Expand Up @@ -8,7 +8,6 @@
'use strict';

var assign = require('object-assign');
var has = require('has');

var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
var checkPropTypes = require('./checkPropTypes');
Expand Down Expand Up @@ -319,7 +318,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 (has(propValue, key)) {
if (Object.prototype.hasOwnProperty.call(propValue, key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error instanceof Error) {
return error;
Expand Down
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -26,8 +26,7 @@
"homepage": "https://facebook.github.io/react/",
"dependencies": {
"loose-envify": "^1.3.1",
"object-assign": "^4.1.1",
"has": "^1.0.1"
"object-assign": "^4.1.1"
},
"scripts": {
"test": "jest",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Expand Up @@ -1239,7 +1239,7 @@ has-flag@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa"

has@^1.0.0, has@^1.0.1:
has@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28"
dependencies:
Expand Down

0 comments on commit 6fef996

Please sign in to comment.