@decisiv/prop-types
Advanced tools
Comparing version 1.6.6 to 1.6.7
@@ -6,2 +6,10 @@ # Change Log | ||
## [1.6.7](https://github.com/Decisiv/decisiv-design-system/compare/@decisiv/prop-types@1.6.6...@decisiv/prop-types@1.6.7) (2019-11-22) | ||
**Note:** Version bump only for package @decisiv/prop-types | ||
## [1.6.6](https://github.com/Decisiv/decisiv-design-system/compare/@decisiv/prop-types@1.6.5...@decisiv/prop-types@1.6.6) (2019-11-15) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "@decisiv/prop-types", | ||
"version": "1.6.6", | ||
"version": "1.6.7", | ||
"description": "Decisiv's custom React PropType validators.", | ||
@@ -34,3 +34,3 @@ "author": "Decisiv UI Development Team", | ||
"private": false, | ||
"gitHead": "06a3fd375310abc0d14924581ef075fe5e01d252" | ||
"gitHead": "3a4b6e3d4e760880e31811fd798546fefb6f30ff" | ||
} |
# PropTypes | ||
This package exports a variety of useful proptype validators for use within the | ||
This package exports a variety of useful prop-type validators for the | ||
[Key Design System](https://key-design-system.decisiv.com). | ||
@@ -26,6 +26,6 @@ | ||
Used inside of proptypes declaration object as the validator itself. Takes two | ||
arguments: a proptypes validator and a conditional. Allows you to conditionally | ||
forbid a prop value based on other props/ logic. The prop is forbidden if the | ||
condition returns true. | ||
Used inside of a component's `propTypes` declaration object as the validator | ||
itself for a given prop. Takes two arguments: a validator and a conditional. | ||
Allows you to conditionally forbid a prop value based on other props/logic. The | ||
prop is forbidden if the condition returns `true`. | ||
@@ -47,4 +47,4 @@ Example use: | ||
Takes an object containing valid proptypes. Will error if some props are | ||
defined, but not if either _all_ or _none_ of the props are defined. | ||
Takes an object containing props with validators. Will error if values for some | ||
props are defined, but not if either _all_ or _none_ of the props are provided. | ||
@@ -61,3 +61,3 @@ Example use: | ||
requireAllOfNoneOf(propTypes); | ||
requireAllOrNoneOf(propTypes); | ||
@@ -69,4 +69,5 @@ YourComponent.propTypes = propTypes; | ||
Takes an object containing valid proptypes. Will error if none of the props are | ||
defined, but not if one or more are defined. | ||
Takes an object containing props with validators. Will error if none of the | ||
props are provided, but _not_ if values are provided for one or more of the | ||
props. | ||
@@ -110,6 +111,7 @@ Example use: | ||
Used inside of proptypes declaration object as the validator itself. Takes two | ||
arguments: a proptypes validator and a function. Allows you to conditionally | ||
require a prop value based on other props/ logic. The prop is required if the | ||
condition return true. | ||
Used inside of a component's `propTypes` declaration object as the validator | ||
itself for a given prop. Takes two arguments: a `PropTypes` validator and a | ||
predicate function. This allows you to conditionally require a prop value based | ||
on other props/logic. The prop is required (and the supplied validator is | ||
applied to the prop) if the predicate function returns `true`. | ||
@@ -116,0 +118,0 @@ Example use: |
31236
125