Xtra Type Cafety

This commit is contained in:
Cohee 2024-09-28 13:59:03 +03:00
parent b1bb41313f
commit ac1bc95551

View File

@ -812,6 +812,10 @@ function showTypeSpecificControls(type) {
* @returns {void} * @returns {void}
*/ */
function insertMissingArrayItems(source, target) { function insertMissingArrayItems(source, target) {
if (source === target || !Array.isArray(source) || !Array.isArray(target)) {
return;
}
for (const item of source) { for (const item of source) {
if (!target.includes(item)) { if (!target.includes(item)) {
const index = source.indexOf(item); const index = source.indexOf(item);