This add the validation you mention:

          if (slots.length < 2) {
            throw new Error($('The website must have at least two slots to apply swap'));
          } else if (slots.length > 2 && (!slot1 || !slot2)) {
            throw new Error($('The website has more than 2 slots you must specify which ones to swap'))
          }

          if (slot1) {
            verifySlotExists(slot1);
          }

          if (slot2) {
            verifySlotExists(slot2);
          }

          if (slots.length === 2) {
            // Independently of what the user passed,
            // there's only two slots, so switch those ones
            slot1 = slots[0];
            slot2 = slots[1];
          }

          if (utils.ignoreCaseEquals(slot1, slot2)) {
            throw new Error($('Specified slots must be different'));
          }