Huge News!Announcing our $40M Series B led by Abstract Ventures.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.1.1 to 0.1.2

13

lib/index.js

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

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

@@ -39,2 +42,12 @@ this.required = true;

},
get arrayOf() {
return function (validator) {
return checkerFactory('arrayOf', function (prop) {
prop.forEach(function (p) {
return validator.validate(p);
});
return true;
});
};
},
get bool() {

@@ -41,0 +54,0 @@ return checkerFactory('bool', 'boolean');

2

package.json
{
"name": "deku-prop-types",
"version": "0.1.1",
"version": "0.1.2",
"description": "Prop type validation for Deku components",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -52,2 +52,21 @@ # deku-prop-types

Validate prop is an array
### propTypes.arrayOf
Validate prop is an array consisting of a type
```jsx
import {element} from 'deku'
import {validate} from 'deku-prop-types'
const NamesList = ({props}) => <div>
{props.names.map(name => <div>{name}</div>)}
</div>
NamesList.propTypes = {
names: propTypes.arrayOf(propTypes.string)
}
export default validate(NamesList)
```
### propTypes.bool

@@ -54,0 +73,0 @@ Validate prop is a boolean

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