Change type check error to warn

This commit is contained in:
Chi-Hsuan Huang 2022-05-19 15:00:20 +08:00
parent c152efb71a
commit aebefa45c6
1 changed files with 8 additions and 2 deletions

View File

@ -388,15 +388,21 @@ const getDateParamsFromQueryMemoized = memoize<
);
if ( typeof queryDefaults.period !== 'string' ) {
throw Error(
/* eslint-disable no-console */
console.warn(
`Unexpected default period type ${ queryDefaults.period }`
);
/* eslint-enable no-console */
queryDefaults.period = '';
}
if ( typeof queryDefaults.compare !== 'string' ) {
throw Error(
/* eslint-disable no-console */
console.warn(
`Unexpected default compare type ${ queryDefaults.compare }`
);
/* eslint-enable no-console */
queryDefaults.compare = '';
}
return {