New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

extended-proptypes

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extended-proptypes - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

4

lib/factories/makeChainedValidator.js

@@ -11,5 +11,5 @@ "use strict";

return function (props, propName, componentName, location) {
return function () {
for (var i = 0; i < validators.length; i++) {
var result = validators[i](props, propName, componentName, location);
var result = validators[i].apply(validators, arguments);
if (result) return result;

@@ -16,0 +16,0 @@ }

@@ -21,3 +21,3 @@ "use strict";

return function () {
var validator = validatorFactory.apply(null, arguments);
var validator = validatorFactory.apply(undefined, arguments);
var output = _makeOptionalValidator2["default"](validator);

@@ -24,0 +24,0 @@ output.isRequired = _makeRequiredValidator2["default"](validator);

@@ -8,7 +8,11 @@ // Takes a validator and returns one that passes if no prop is defined.

function makeOptionalValidator(validator) {
return function (props, propName, componentName, location) {
return function (props, propName) {
if (props[propName] == null) {
return null;
} else {
return validator(props, propName, componentName, location);
for (var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
rest[_key - 2] = arguments[_key];
}
return validator.apply(undefined, [props, propName].concat(rest));
}

@@ -15,0 +19,0 @@ };

@@ -8,7 +8,11 @@ // Takes a validator and returns one that fails if no prop is defined.

function makeRequiredValidator(validator) {
return function (props, propName, componentName, location) {
return function (props, propName, componentName) {
if (props[propName] == null) {
return new Error("Required prop `" + propName + "` was not specified in `" + componentName + "`");
} else {
return validator(props, propName, componentName, location);
for (var _len = arguments.length, rest = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
rest[_key - 3] = arguments[_key];
}
return validator.apply(undefined, [props, propName, componentName].concat(rest));
}

@@ -15,0 +19,0 @@ };

@@ -10,5 +10,10 @@ "use strict";

var keys = Object.keys(obj);
for (var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
rest[_key - 2] = arguments[_key];
}
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var validatorError = validator(obj, key);
var validatorError = validator.apply(undefined, [obj, key].concat(rest));
if (validatorError) return validatorError;

@@ -15,0 +20,0 @@ }

{
"name": "extended-proptypes",
"version": "1.1.3",
"version": "1.1.4",
"description": "Useful proptypes for react components",

@@ -25,3 +25,3 @@ "main": "lib/index.js",

"mocha-lcov-reporter": "^1.2.0",
"react": "^15.0.1"
"proptypes": "^0.14.3"
},

@@ -28,0 +28,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc