Skip to main content
The Deno 2 Release Candidate is here
Learn more
method InsuranceController.prototype.processAttachmentByParent
import { InsuranceController } from "https://deno.land/x/sptaki@1.2.0/controllers/InsuranceController.d.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.

traderId: string

The ID of the trader to that has ensured these items.

toDelete: Set<string>

The array that accumulates the IDs of the items to be deleted.

Returns

void

void