react-router-query-params
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -30,4 +30,2 @@ import _defineProperty from 'babel-runtime/helpers/defineProperty'; | ||
_Object$keys(keys).forEach(function (key) { | ||
assert(keys[key].default, 'Missing default value for key ' + key); | ||
assert(typeof keys[key].default === 'string' || typeof keys[key].default === 'function', '\'default\' for key ' + key + ' must be a string or a function'); | ||
assert(keys[key].validate, 'Missing validate function for key ' + key); | ||
@@ -34,0 +32,0 @@ assert(typeof keys[key].validate === 'function', '\'validate\' for ' + key + ' must be a function'); |
@@ -76,4 +76,2 @@ 'use strict'; | ||
(0, _keys2.default)(keys).forEach(function (key) { | ||
(0, _utils.assert)(keys[key].default, 'Missing default value for key ' + key); | ||
(0, _utils.assert)(typeof keys[key].default === 'string' || typeof keys[key].default === 'function', '\'default\' for key ' + key + ' must be a string or a function'); | ||
(0, _utils.assert)(keys[key].validate, 'Missing validate function for key ' + key); | ||
@@ -80,0 +78,0 @@ (0, _utils.assert)(typeof keys[key].validate === 'function', '\'validate\' for ' + key + ' must be a function'); |
{ | ||
"name": "react-router-query-params", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Set query parameters with a schema for react-router.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -92,3 +92,3 @@ # react-router-query-params | ||
* __`default`__ (string|function): Define the default value for the query parameter. If query parameter valiation fails or it is undefined, the HoC automatically sets the query parameter to this value. Examples: | ||
* __`default`__ (any): Define the default value for the query parameter. If query parameter valiation fails or it is undefined, the HoC automatically sets the query parameter to this value. Examples: | ||
- `default: 'example'`: sets 'example' as default value | ||
@@ -95,0 +95,0 @@ - `default: (value, props) => props.defaultParam'`: sets `defaultParam` from the component props as default value |
@@ -20,7 +20,2 @@ import React, { PureComponent } from 'react'; | ||
Object.keys(keys).forEach((key) => { | ||
assert(keys[key].default, `Missing default value for key ${key}`); | ||
assert( | ||
typeof keys[key].default === 'string' || typeof keys[key].default === 'function', | ||
`'default' for key ${key} must be a string or a function`, | ||
); | ||
assert(keys[key].validate, `Missing validate function for key ${key}`); | ||
@@ -27,0 +22,0 @@ assert(typeof keys[key].validate === 'function', `'validate' for ${key} must be a function`); |
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
207326
318