1
0
Fork 0

fix(core): Make mergeOptions handle no settings

This commit is contained in:
joostdecock 2023-09-26 15:41:14 +02:00
parent a5c9ed4ecc
commit b387c4d2bd

View file

@ -479,7 +479,7 @@ export function mergeI18n(designs, options) {
* @param {object} optionsConfig - The pattern's options config
* @return {object} result - An object with the merged options and their values
*/
export function mergeOptions(settings, optionsConfig) {
export function mergeOptions(settings = {}, optionsConfig) {
const merged = typeof settings.options === 'undefined' ? {} : { ...settings.option }
for (const [key, option] of Object.entries(optionsConfig)) {
if (typeof option === 'object') {