Skip to content
Merged
Prev Previous commit
Next Next commit
feat(overlay): fix typos in options validator to correctly inject def…
…aults
  • Loading branch information
pmmmwh committed Mar 2, 2020
commit dc4c6609ff06ae3733ce76f83156840cf3f99ae9
7 changes: 5 additions & 2 deletions src/helpers/validateOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const defaultOptions = {
/** @type {import('../types').ErrorOverlayOptions} */
const defaultOverlayOptions = {
entry: require.resolve('../runtime/ErrorOverlayEntry'),
overlay: require.resolve('../overlay'),
module: require.resolve('../overlay'),
};

/**
Expand All @@ -19,7 +19,10 @@ const defaultOverlayOptions = {
module.exports = function validateOptions(options) {
const validatedOptions = Object.assign(defaultOptions, options);

if (typeof validatedOptions.overlay !== 'boolean') {
if (
typeof validatedOptions.overlay !== 'undefined' &&
typeof validatedOptions.overlay !== 'boolean'
) {
if (typeof validatedOptions.overlay.module !== 'string') {
throw new Error(
`To use the "overlay" option, a string must be provided in the "module" property. Instead, the provided value has type: "${typeof options
Expand Down