fix(core): Make mergeOptions handle no settings
This commit is contained in:
parent
a5c9ed4ecc
commit
b387c4d2bd
1 changed files with 1 additions and 1 deletions
|
@ -479,7 +479,7 @@ export function mergeI18n(designs, options) {
|
||||||
* @param {object} optionsConfig - The pattern's options config
|
* @param {object} optionsConfig - The pattern's options config
|
||||||
* @return {object} result - An object with the merged options and their values
|
* @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 }
|
const merged = typeof settings.options === 'undefined' ? {} : { ...settings.option }
|
||||||
for (const [key, option] of Object.entries(optionsConfig)) {
|
for (const [key, option] of Object.entries(optionsConfig)) {
|
||||||
if (typeof option === 'object') {
|
if (typeof option === 'object') {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue