deku-prop-types-immutable
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -118,2 +118,17 @@ 'use strict'; | ||
}, | ||
get shape() { | ||
return function (shape) { | ||
return (0, _checkerFactory2.default)('shape', function (prop, key) { | ||
var validators = Object.keys(shape); | ||
for (var i = 0; i < validators.length; i++) { | ||
var validatorResult = shape[validators[i]].validate(prop.get(validators[i]), key + '.' + validators[i]); | ||
if (validatorResult instanceof Error) { | ||
return validatorResult; | ||
} | ||
} | ||
}); | ||
}; | ||
}, | ||
get stack() { | ||
@@ -120,0 +135,0 @@ return immutableCheckerFactory('Stack'); |
{ | ||
"name": "deku-prop-types-immutable", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Immutable prop type validation for Deku components", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -84,2 +84,4 @@ # deku-prop-types-immutable | ||
Validate each value is of a certain type | ||
### ImmutablePropTypes.shape | ||
Validate a property's value matches the specified type. This works with `Iterable`, `Map`, and `OrderedMap`. | ||
### ImmutablePropTypes.stack | ||
@@ -86,0 +88,0 @@ Validate prop is an [Immutable.Stack](https://facebook.github.io/immutable-js/docs/#/Stack) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10524
121
92