🐛 Fixed issue where pattern.mergeSettings() wouldn't handle array correctly
This commit is contained in:
parent
6503108e20
commit
63d07c09ad
1 changed files with 5 additions and 1 deletions
|
@ -81,7 +81,11 @@ Pattern.prototype.createPart = function() {
|
|||
// Merges settings object with this.settings
|
||||
Pattern.prototype.mergeSettings = function(settings) {
|
||||
for (let key of Object.keys(settings)) {
|
||||
if (typeof settings[key] === "object") {
|
||||
if (Array.isArray(settings[key])) {
|
||||
if (Array.isArray(this.settings[key])) {
|
||||
for (let entry of settings[key]) this.settings[key].push(entry);
|
||||
} else this.settings[key] = settings[key];
|
||||
} else if (typeof settings[key] === "object") {
|
||||
this.settings[key] = {
|
||||
...this.settings[key],
|
||||
...settings[key]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue