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

deku-prop-types

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deku-prop-types - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

30

lib/index.js

@@ -7,5 +7,2 @@ 'use strict';

return {
get name() {
return name;
},
get isRequired() {

@@ -52,2 +49,5 @@ this.required = true;

return checkerFactory('arrayOf', function (prop, key) {
if (!Array.isArray(prop)) {
return new TypeError(key + ' is not an `Array`');
}
var anyErrors = prop.some(function (p) {

@@ -90,8 +90,10 @@ return validator.validate(p) instanceof Error;

return checkerFactory('objectOf', function (prop, key) {
var anyErrors = Object.keys(prop).some(function (p) {
return validator.validate(prop[p]) instanceof Error;
});
var propKeys = Object.keys(prop);
if (anyErrors) {
return new TypeError(key + ' does not consist of all properties with `' + validator.name + '` values');
for (var i = 0; i < propKeys.length; i++) {
var validatorResult = validator.validate(prop[propKeys[i]], key + '.' + propKeys[i]);
if (validatorResult instanceof Error) {
return validatorResult;
}
}

@@ -134,8 +136,10 @@

return checkerFactory('shape', function (prop, key) {
var anyErrors = Object.keys(propsObj).some(function (validator) {
return propsObj[validator].validate(prop[validator]) instanceof Error;
});
var validators = Object.keys(propsObj);
if (anyErrors) {
return new TypeError(key + ' does not have the correct value types');
for (var i = 0; i < validators.length; i++) {
var validatorResult = propsObj[validators[i]].validate(prop[validators[i]], key + '.' + validators[i]);
if (validatorResult instanceof Error) {
return validatorResult;
}
}

@@ -142,0 +146,0 @@

{
"name": "deku-prop-types",
"version": "0.2.1",
"version": "0.2.2",
"description": "Prop type validation for Deku components",

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

"devDependencies": {
"ava": "^0.10.0",
"ava": "^0.11.0",
"babel": "^6.3.26",

@@ -27,0 +27,0 @@ "babel-cli": "^6.4.0",

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