| 805 | 805 | }); |
| 806 | 806 | } |
| 807 | 807 | |
| 808 | +/** |
| 809 | + * Inserts missing items from the source array into the target array. |
| 810 | + * @param {any[]} source - Source array |
| 811 | + * @param {any[]} target - Target array |
| 812 | + * @returns {void} |
| 813 | + */ |
| 814 | +function insertMissingArrayItems(source, target) { |
| 815 | + for (const item of source) { |
| 816 | + if (!target.includes(item)) { |
| 817 | + const index = source.indexOf(item); |
| 818 | + target.splice(index, 0, item); |
| 819 | + } |
| 820 | + } |
| 821 | +} |
| 822 | + |
| 808 | 823 | function setSettingByName(setting, value, trigger) { |
| 809 | 824 | if (value === null || value === undefined) { |
| 810 | 825 | return; |