import type { LimitedResource, Resource } from "@src/component"; import { LitElement } from "lit"; export class ComponentObjectHandler extends LitElement { object?: LimitedResource = { "@id": "", }; isType = (type: string, obj?: Resource) => { const resource = obj ?? (this.object as Resource); const typeValue = resource["@type"]; if (Array.isArray(typeValue)) { return typeValue.includes(type); } if (typeof typeValue === "string") { return typeValue === type; } return false; }; }