import { InsuranceController } from "https://deno.land/x/sptaki@1.2.0/controllers/mod.ts";
Takes an array of attachment items that belong to the same main-parent item, sorts them in descending order by their maximum price. For each attachment, a roll is made to determine if a deletion should be made. Once the number of deletions has been counted, the attachments are added to the toDelete Set, starting with the most valuable attachments first.
Parameters
attachments: Item[]
The array of attachment items to sort, filter, and roll.