deku-prop-types
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -7,5 +7,7 @@ 'use strict'; | ||
* @param {Object} props - an object to check for missing propTypes | ||
* @param {Number} warningLevel - should warn when missing propType discovered | ||
* @param {Number} warningLevel - should warn/error when missing propType discovered | ||
* 0 - do not warn | ||
* 1 - console.warn | ||
* 2 - throw Error | ||
* @throws {Error} - if warningLevel is 2 and missing propType discovered | ||
*/ | ||
@@ -23,3 +25,11 @@ var warnOfMissingPropTypes = function warnOfMissingPropTypes(propTypes, props, warningLevel) { | ||
}).forEach(function (missingProp) { | ||
console.warn('Missing `' + missingProp + '` propType'); | ||
var msg = 'Missing `' + missingProp + '` propType'; | ||
if (warningLevel === 1) { | ||
console.warn(msg); | ||
} | ||
if (warningLevel === 2) { | ||
throw new Error(msg); | ||
} | ||
}); | ||
@@ -26,0 +36,0 @@ }; |
{ | ||
"name": "deku-prop-types", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Prop type validation for Deku components", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
16442
211