Skip to main content
The Deno 2 Release Candidate is here
Learn more
method ItemHelper.prototype.adoptOrphanedItems
import { ItemHelper } from "https://deno.land/x/sptaki@1.2.0/helpers/ItemHelper.d.ts";

Adopts orphaned items by resetting them as root "hideout" items. Helpful in situations where a parent has been deleted from a group of items and there are children still referencing the missing parent. This method will remove the reference from the children to the parent and set item properties to root values.

Parameters

rootId: string

The ID of the "root" of the container.

items: Item[]

Array of Items that should be adjusted.

Returns

Array of Items that have been adopted.