react-immutable-proptypes
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -0,1 +1,4 @@ | ||
## 2.1.0 | ||
- fix the new React 15.3.x PropType warnings | ||
## 2.0.0 | ||
@@ -2,0 +5,0 @@ - [Aldredcz](https://github.com/Aldredcz) made map key validation happen |
@@ -58,2 +58,6 @@ /** | ||
function checkType(isRequired, props, propName, componentName, location, propFullName) { | ||
for (var _len = arguments.length, rest = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) { | ||
rest[_key - 6] = arguments[_key]; | ||
} | ||
propFullName = propFullName || propName; | ||
@@ -67,3 +71,3 @@ componentName = componentName || ANONYMOUS; | ||
} else { | ||
return validate(props, propName, componentName, location, propFullName); | ||
return validate.apply(undefined, [props, propName, componentName, location, propFullName].concat(rest)); | ||
} | ||
@@ -93,2 +97,6 @@ } | ||
function validate(props, propName, componentName, location, propFullName) { | ||
for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { | ||
rest[_key - 5] = arguments[_key]; | ||
} | ||
var propValue = props[propName]; | ||
@@ -107,3 +115,3 @@ if (!immutableClassTypeValidator(propValue)) { | ||
for (var i = 0, len = propValues.length; i < len; i++) { | ||
var error = typeChecker(propValues, i, componentName, location, "" + propFullName + "[" + i + "]"); | ||
var error = typeChecker.apply(undefined, [propValues, i, componentName, location, "" + propFullName + "[" + i + "]"].concat(rest)); | ||
if (error instanceof Error) { | ||
@@ -120,2 +128,6 @@ return error; | ||
function validate(props, propName, componentName, location, propFullName) { | ||
for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { | ||
rest[_key - 5] = arguments[_key]; | ||
} | ||
var propValue = props[propName]; | ||
@@ -128,3 +140,3 @@ if (typeof typeChecker !== "function") { | ||
for (var i = 0, len = keys.length; i < len; i++) { | ||
var error = typeChecker(keys, i, componentName, location, "" + propFullName + " -> key(" + keys[i] + ")"); | ||
var error = typeChecker.apply(undefined, [keys, i, componentName, location, "" + propFullName + " -> key(" + keys[i] + ")"].concat(rest)); | ||
if (error instanceof Error) { | ||
@@ -180,2 +192,6 @@ return error; | ||
function validate(props, propName, componentName, location, propFullName) { | ||
for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { | ||
rest[_key - 5] = arguments[_key]; | ||
} | ||
var propValue = props[propName]; | ||
@@ -193,3 +209,3 @@ if (!(propValue instanceof Immutable.Record)) { | ||
var mutablePropValue = propValue.toObject(); | ||
var error = checker(mutablePropValue, key, componentName, location, "" + propFullName + "." + key); | ||
var error = checker.apply(undefined, [mutablePropValue, key, componentName, location, "" + propFullName + "." + key].concat(rest)); | ||
if (error) { | ||
@@ -209,2 +225,6 @@ return error; | ||
function validate(props, propName, componentName, location, propFullName) { | ||
for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { | ||
rest[_key - 5] = arguments[_key]; | ||
} | ||
var propValue = props[propName]; | ||
@@ -222,3 +242,3 @@ if (!immutableClassTypeValidator(propValue)) { | ||
} | ||
var error = checker(mutablePropValue, key, componentName, location, "" + propFullName + "." + key); | ||
var error = checker.apply(undefined, [mutablePropValue, key, componentName, location, "" + propFullName + "." + key].concat(rest)); | ||
if (error) { | ||
@@ -225,0 +245,0 @@ return error; |
{ | ||
"name": "react-immutable-proptypes", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "PropType validators that work with Immutable.js.", | ||
@@ -5,0 +5,0 @@ "main": "dist/ImmutablePropTypes.js", |
@@ -53,3 +53,3 @@ /** | ||
function createChainableTypeChecker(validate) { | ||
function checkType(isRequired, props, propName, componentName, location, propFullName) { | ||
function checkType(isRequired, props, propName, componentName, location, propFullName, ...rest) { | ||
propFullName = propFullName || propName; | ||
@@ -66,3 +66,3 @@ componentName = componentName || ANONYMOUS; | ||
} else { | ||
return validate(props, propName, componentName, location, propFullName); | ||
return validate(props, propName, componentName, location, propFullName, ...rest); | ||
} | ||
@@ -94,3 +94,3 @@ } | ||
function validate(props, propName, componentName, location, propFullName) { | ||
function validate(props, propName, componentName, location, propFullName, ...rest) { | ||
var propValue = props[propName]; | ||
@@ -115,3 +115,3 @@ if (!immutableClassTypeValidator(propValue)) { | ||
for (var i = 0, len = propValues.length; i < len; i++) { | ||
var error = typeChecker(propValues, i, componentName, location, `${propFullName}[${i}]`); | ||
var error = typeChecker(propValues, i, componentName, location, `${propFullName}[${i}]`, ...rest); | ||
if (error instanceof Error) { | ||
@@ -127,3 +127,3 @@ return error; | ||
function validate(props, propName, componentName, location, propFullName) { | ||
function validate(props, propName, componentName, location, propFullName, ...rest) { | ||
var propValue = props[propName]; | ||
@@ -139,3 +139,3 @@ if (typeof typeChecker !== 'function') { | ||
for (var i = 0, len = keys.length; i < len; i++) { | ||
var error = typeChecker(keys, i, componentName, location, `${propFullName} -> key(${keys[i]})`); | ||
var error = typeChecker(keys, i, componentName, location, `${propFullName} -> key(${keys[i]})`, ...rest); | ||
if (error instanceof Error) { | ||
@@ -187,3 +187,3 @@ return error; | ||
function createRecordOfTypeChecker(recordKeys) { | ||
function validate(props, propName, componentName, location, propFullName) { | ||
function validate(props, propName, componentName, location, propFullName, ...rest) { | ||
var propValue = props[propName]; | ||
@@ -204,3 +204,3 @@ if (!(propValue instanceof Immutable.Record)) { | ||
var mutablePropValue = propValue.toObject(); | ||
var error = checker(mutablePropValue, key, componentName, location, `${propFullName}.${key}`); | ||
var error = checker(mutablePropValue, key, componentName, location, `${propFullName}.${key}`, ...rest); | ||
if (error) { | ||
@@ -216,3 +216,3 @@ return error; | ||
function createShapeTypeChecker(shapeTypes, immutableClassName = 'Iterable', immutableClassTypeValidator = Immutable.Iterable.isIterable) { | ||
function validate(props, propName, componentName, location, propFullName) { | ||
function validate(props, propName, componentName, location, propFullName, ...rest) { | ||
var propValue = props[propName]; | ||
@@ -233,3 +233,3 @@ if (!immutableClassTypeValidator(propValue)) { | ||
} | ||
var error = checker(mutablePropValue, key, componentName, location, `${propFullName}.${key}`); | ||
var error = checker(mutablePropValue, key, componentName, location, `${propFullName}.${key}`, ...rest); | ||
if (error) { | ||
@@ -236,0 +236,0 @@ return error; |
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
29720
426