import type { Resource } from "@src/component"; import { LitElement } from "lit"; import { property } from "lit/decorators.js"; export class ComponentObjectsHandler extends LitElement { @property({ attribute: false }) objects?: Resource[] = []; hasType = (type: string, objs?: Resource[]) => { const resources = objs ?? this.objects ?? []; return resources.some((o) => { const typeValue = o["@type"]; if (Array.isArray(typeValue)) return typeValue.includes(type); if (typeof typeValue === "string") return typeValue === type; return false; }); }; }