Xtra Type Cafety
| @@ -812,6 +812,10 @@ function showTypeSpecificControls(type) { | |||
| 812 | * @returns {void} | 812 | * @returns {void} |
| 813 | */ | 813 | */ |
| 814 | function insertMissingArrayItems(source, target) { | 814 | function insertMissingArrayItems(source, target) { |
| 815 | if (source === target || !Array.isArray(source) || !Array.isArray(target)) { | ||
| 816 | return; | ||
| 817 | } | ||
| 818 | |||
| 815 | for (const item of source) { | 819 | for (const item of source) { |
| 816 | if (!target.includes(item)) { | 820 | if (!target.includes(item)) { |
| 817 | const index = source.indexOf(item); | 821 | const index = source.indexOf(item); |